Guest User

Untitled

a guest
Jan 18th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1.     def save(self, commit=True):
  2.         try:
  3.             # instance = super(CategoryForm, self).save(commit=False)
  4.             instance = super(CategoryForm, self).save()
  5.             return instance
  6.         except Exception as e:
  7.             if isinstance(e, CategoryRootCheckError):
  8.                 self.add_error('title', '')
  9.                 self.add_error('parent', '')
  10.                 raise forms.ValidationError(e)
Advertisement
Add Comment
Please, Sign In to add comment