From 562a2189f7406a56c56bbe80215e1eef249322b9 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Mon, 15 Mar 2021 10:42:28 +0530 Subject: [PATCH] feat: email as name field for community member --- .../community_member/community_member.json | 3 ++- .../doctype/community_member/community_member.py | 4 ++-- .../web_form/update_profile/update_profile.json | 15 +-------------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/community/community/doctype/community_member/community_member.json b/community/community/doctype/community_member/community_member.json index 9ac49269..5d9330f2 100644 --- a/community/community/doctype/community_member/community_member.json +++ b/community/community/doctype/community_member/community_member.json @@ -1,6 +1,7 @@ { "actions": [], "allow_guest_to_view": 1, + "autoname": "field:email", "creation": "2021-02-12 15:47:23.591567", "doctype": "DocType", "editable_grid": 1, @@ -78,7 +79,7 @@ "has_web_view": 1, "index_web_pages_for_search": 1, "links": [], - "modified": "2021-03-12 10:23:09.709669", + "modified": "2021-03-12 17:41:32.786762", "modified_by": "Administrator", "module": "Community", "name": "Community Member", diff --git a/community/community/doctype/community_member/community_member.py b/community/community/doctype/community_member/community_member.py index 57762bcb..f3fd9541 100644 --- a/community/community/doctype/community_member/community_member.py +++ b/community/community/doctype/community_member/community_member.py @@ -22,8 +22,8 @@ class CommunityMember(WebsiteGenerator): if self.user_name: if len(self.user_name) < 4: frappe.throw(_("Username must be atleast 4 characters long.")) - if not re.match("^[A-Za-z0-9]*$", self.user_name): - frappe.throw(_("Username can only contain alphabets, and numbers.")) + if not re.match("^[A-Za-z0-9_]*$", self.user_name): + frappe.throw(_("Username can only contain alphabets, numbers and underscore.")) self.user_name = self.user_name.lower() def autoname(self): diff --git a/community/community/web_form/update_profile/update_profile.json b/community/community/web_form/update_profile/update_profile.json index 24d1f2db..b762e1f6 100644 --- a/community/community/web_form/update_profile/update_profile.json +++ b/community/community/web_form/update_profile/update_profile.json @@ -19,7 +19,7 @@ "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2021-03-12 10:23:37.625177", + "modified": "2021-03-12 18:14:19.363139", "modified_by": "Administrator", "module": "Community", "name": "update-profile", @@ -60,19 +60,6 @@ "reqd": 0, "show_in_filter": 0 }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "email", - "fieldtype": "Data", - "hidden": 0, - "label": "Email", - "max_length": 0, - "max_value": 0, - "options": "Email", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, { "allow_read_on_all_link_options": 0, "fieldname": "short_intro",