diff --git a/app/Login.py b/app/Login.py index 1301c1c..1ada0af 100644 --- a/app/Login.py +++ b/app/Login.py @@ -93,9 +93,9 @@ class UserName: return f'{self.username} is too long. The user name cannot exceed 20 characters.' if self.username.startswith('.'): # a user name must not start with a dot return 'Period (.) is not allowed as the first letter in the user name.' - if ' ' in self.username: # a user must not include a whitespace + if ' ' in self.username: # a user name must not include a whitespace return 'Whitespace is not allowed in the user name.' - for c in self.username: # a user name not include special characters + for c in self.username: # a user name must not include special characters, except non-leading periods or underscores if c in string.punctuation and c is not '.' and c is not '_': return f'{c} is not allowed in the user name.' if self.username in ['signup', 'login', 'logout', 'reset', 'mark', 'back', 'unfamiliar', 'familiar', 'del']: diff --git a/app/account_service.py b/app/account_service.py index b50478b..09439d5 100644 --- a/app/account_service.py +++ b/app/account_service.py @@ -1,6 +1,6 @@ from flask import * from Login import check_username_availability, verify_user, add_user, get_expiry_date, change_password, WarningMessage -import re + # 初始化蓝图 accountService = Blueprint("accountService", __name__)