Skip to content

Commit

Permalink
Checking once is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Oct 2, 2020
1 parent 1d4ce6d commit 297be17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions form_designer/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _form_fields(self, cfg_key, cfg):
"form_fields of %r should be a callable" % (cfg_key,),
DeprecationWarning,
)
return form_fields() if callable(form_fields) else form_fields
return form_fields


class FormFieldAdmin(OrderableAdmin, admin.TabularInline):
Expand Down Expand Up @@ -155,12 +155,12 @@ def _form_fields(self, cfg_key, cfg):
if not form_fields:
return []
if callable(form_fields):
return form_fields(self) # TODO arguments?
return form_fields(None) # TODO arguments?
warnings.warn(
"form_fields of %r should be a callable" % (cfg_key,),
DeprecationWarning,
)
return form_fields() if callable(form_fields) else form_fields
return form_fields

def get_fieldsets(self, request, obj=None):
fieldsets = [
Expand Down

0 comments on commit 297be17

Please sign in to comment.