Skip to content

Commit

Permalink
Catch KeyError.
Browse files Browse the repository at this point in the history
  • Loading branch information
zsiciarz committed Jan 24, 2013
1 parent d5d2e3b commit 2cbc197
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion envelope/forms.py
Expand Up @@ -194,6 +194,6 @@ def get_category_display(self):
"""
try:
category = int(self.cleaned_data['category'])
except (AttributeError, ValueError):
except (AttributeError, ValueError, KeyError):
category = None
return dict(self.get_category_choices()).get(category)

0 comments on commit 2cbc197

Please sign in to comment.