Skip to content

Commit

Permalink
validate that create_form returned a value
Browse files Browse the repository at this point in the history
fixes #71
  • Loading branch information
guruofgentoo committed Jan 28, 2021
1 parent 4d7497c commit 83ff034
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions keg_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def update_obj(self, obj, form):

def add_edit(self, meth, obj=None):
form = self.create_form(obj)
if form is None:
raise Exception('create_form returned None instead of a form instance')
if meth == 'POST':
if form.validate():
result = self.update_obj(obj, form)
Expand Down

0 comments on commit 83ff034

Please sign in to comment.