diff --git a/raven/raven/doctype/raven_user/raven_user.py b/raven/raven/doctype/raven_user/raven_user.py index c9bf1a1a1..ee018dafb 100644 --- a/raven/raven/doctype/raven_user/raven_user.py +++ b/raven/raven/doctype/raven_user/raven_user.py @@ -36,6 +36,13 @@ def before_validate(self): if not self.full_name: self.full_name = self.first_name + def validate(self): + if self.type == "Bot" and not self.bot: + frappe.throw(_("Bot is mandatory")) + + if self.type == "User" and not self.user: + frappe.throw(_("User is mandatory")) + def before_save(self): if self.type != "Bot": self.update_photo_from_user()