Browse Source

[fix] patch

version-14
Rushabh Mehta 9 years ago
parent
commit
93e3ac2770
2 changed files with 3 additions and 2 deletions
  1. +2
    -1
      frappe/core/doctype/user/user.py
  2. +1
    -1
      frappe/patches/v6_15/set_username.py

+ 2
- 1
frappe/core/doctype/user/user.py View File

@@ -316,7 +316,8 @@ class User(Document):

# should be made up of characters, numbers and underscore only
if not re.match(r"^[\w]+$", self.username):
frappe.throw(_("Username should not contain any special characters other than letters, numbers and underscore"))
frappe.msgprint(_("Username should not contain any special characters other than letters, numbers and underscore"))
self.username = ""

def suggest_username(self):
def _check_suggestion(suggestion):


+ 1
- 1
frappe/patches/v6_15/set_username.py View File

@@ -7,7 +7,7 @@ def execute():
users = frappe.db.sql_list("""select name from `tabUser` order by if(user_type='System User', 0, 1)""")
for name in users:
user = frappe.get_doc("User", name)
if user.username:
if user.username or not user.first_name:
continue

username = user.suggest_username()


Loading…
Cancel
Save