Skip to content

Commit

Permalink
Limit the custom form to the GETs
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Apr 4, 2015
1 parent 0b3ccea commit ef25ef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aldryn_apphooks_config/admin.py
Expand Up @@ -92,7 +92,7 @@ def get_fieldsets(self, request, obj=None):
:return:
"""
app_config_default = self._app_config_select(request, obj)
if app_config_default is None:
if app_config_default is None and request.method == 'GET':
return (_(self.app_config_selection_title),
{'fields': (self.app_config_attribute, ),
'description': _(self.app_config_selection_desc)}),
Expand Down Expand Up @@ -142,7 +142,7 @@ def get_form(self, request, obj=None, **kwargs):
get = copy.copy(request.GET)
get[self.app_config_attribute] = app_config_default.pk
request.GET = get
elif app_config_default is None:
elif app_config_default is None and request.method == 'GET':
class InitialForm(form):
class Meta(form.Meta):
fields = (self.app_config_attribute,)
Expand Down

0 comments on commit ef25ef2

Please sign in to comment.