Merge branch 'main' of https://github.com/frappe/community into batch-discussions

This commit is contained in:
pateljannat
2021-04-28 13:08:23 +05:30
10 changed files with 650 additions and 2 deletions

View File

@@ -28,6 +28,9 @@ class CommunityMember(Document):
frappe.throw(_("Username can only contain alphabets, numbers and underscore."))
self.username = self.username.lower()
def __repr__(self):
return f"<CommunityMember: {self.email}>"
def create_member_from_user(doc, method):
if ( doc.username and username_exists(doc.username)) or not doc.username:
username = create_username_from_email(doc.email)