Merge pull request #325 from Zlash65/min-min

[Minor] Validation fix
This commit is contained in:
Zarrar
2018-10-10 16:56:29 +05:30
committed by GitHub
2 changed files with 2 additions and 4 deletions

View File

@@ -9,8 +9,7 @@ from frappe.model.document import Document
class ConferenceParticipant(Document): class ConferenceParticipant(Document):
def validate(self): def validate(self):
self.conference = '2018' self.conference = '2018'
if self.owner not in ["Guest", "Administrator"] and not self.get("email") \ if self.owner not in ["Guest", "Administrator"] and not self.get("email"):
and frappe.db.get_value("User", self.owner, "user_type") == "Website User":
self.email = frappe.db.get_value('User', self.owner, "email") self.email = frappe.db.get_value('User', self.owner, "email")
def validate_payment(self): def validate_payment(self):

View File

@@ -19,8 +19,7 @@ class ConferenceTalkProposal(WebsiteGenerator):
def validate(self): def validate(self):
self.conference = '2018' self.conference = '2018'
if self.owner not in ["Guest", "Administrator"] and not self.get("email") \ if self.owner not in ["Guest", "Administrator"] and not self.get("email"):
and frappe.db.get_value("User", self.owner, "user_type") == "Website User":
self.email = frappe.db.get_value('User', self.owner, "email") self.email = frappe.db.get_value('User', self.owner, "email")
def get_list_context(context): def get_list_context(context):