Fix for required-fields tag

This commit is contained in:
Tobias 2018-09-29 13:50:25 +12:00
parent 74dc779999
commit a26f9a6f18

View file

@ -1,4 +1,5 @@
from django import template
from django.forms import Form
register = template.Library()
@ -7,6 +8,9 @@ register = template.Library()
@register.filter
def has_required_fields(form):
for field in form:
if isinstance(field, Form):
if has_required_fields(field):
return True
if field.field.required:
return True
return False