When using derivative() + expand_derivatives() more than once, forms can end up being "<empty Form>". When passing an "<empty Form>" to action(), the form has no arguments and hence the lookup arguments[-1] fails with IndexError. This patch catches that IndexError and returns form unmodified.
When using derivative() + expand_derivatives() more than once, forms can end up being "<empty Form>". When passing an "<empty Form>" to action(), the form has no arguments and hence the lookup arguments[-1] fails with IndexError. This patch catches that IndexError and returns form unmodified.