fix: Clear duplicate entry message (#6961)

This commit is contained in:
Aditya Hase 2019-02-19 23:52:57 +05:30 committed by Faris Ansari
parent 56a221573b
commit a87b9cc3bd

View file

@ -83,6 +83,7 @@ def create(user, exists_ok = False, fields = None):
dprof.user = user
dprof.save(ignore_permissions = True)
except frappe.DuplicateEntryError:
frappe.clear_messages()
if not exists_ok:
frappe.throw(_('Chat Profile for User {0} exists.').format(user))