# Process this form
form = formclass(data=request.POST, instance=instance)
+ if hasattr(form, 'filter_by_user'):
+ form.filter_by_user(request.user)
for fn in form.fields:
if fn in getattr(instancetype, 'markdown_fields', []):
form.fields[fn].validators.append(MarkdownValidator)
else:
# Generate form
form = formclass(instance=instance)
-
- if hasattr(form, 'filter_by_user'):
- form.filter_by_user(request.user)
+ if hasattr(form, 'filter_by_user'):
+ form.filter_by_user(request.user)
for fn in form.fields:
if fn in getattr(instancetype, 'markdown_fields', []):