Skip to content

Commit

Permalink
Skip overriding admin form if app_config field not present
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Sep 23, 2015
1 parent c100912 commit 540a482
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aldryn_apphooks_config/admin.py
Expand Up @@ -136,6 +136,8 @@ def get_form(self, request, obj=None, **kwargs):
is used.
"""
form = super(ModelAppHookConfig, self).get_form(request, obj, **kwargs)
if self.app_config_attribute not in form.base_fields:
return form
app_config_default = self._app_config_select(request, obj)
if app_config_default:
form.base_fields[self.app_config_attribute].initial = app_config_default
Expand Down

0 comments on commit 540a482

Please sign in to comment.