Skip to content

Commit

Permalink
Fix fields bound to empty managers being ignored and stop automatical…
Browse files Browse the repository at this point in the history
…ly calling callable attributes
  • Loading branch information
rowanseymour committed Jun 6, 2017
1 parent 357dad5 commit 06e571b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion smartmin/templates/smartmin/field.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% if form_field and form_field.is_hidden %}
{{ form_field }}
{% else %}
{% if form_field %}
{% if form_field != None %}
<div class="form-group {% if form_field.errors %}error{% endif %}">
<label class="col-sm-2 control-label" for="{{ field.name }}">{% get_label field %}</label>
<div class="col-sm-10 smartmin-form-field">
Expand Down
4 changes: 0 additions & 4 deletions smartmin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,6 @@ def lookup_obj_attribute(self, obj, field):
# next up is the object itself
obj_field = getattr(obj, curr_field, None)

# if it is callable, do so
if obj_field and getattr(obj_field, '__call__', None):
obj_field = obj_field()

if obj_field and rest:
return self.lookup_obj_attribute(obj_field, rest)
else:
Expand Down

0 comments on commit 06e571b

Please sign in to comment.