mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
fix missing username pattern
This commit is contained in:
parent
e4a8ad911f
commit
35b239877a
@ -12,6 +12,7 @@ from werkzeug.utils import secure_filename
|
|||||||
import json
|
import json
|
||||||
import jwt
|
import jwt
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import requests
|
import requests
|
||||||
import secrets
|
import secrets
|
||||||
import shutil
|
import shutil
|
||||||
@ -518,6 +519,7 @@ class User(HashidMixin, UserMixin, db.Model):
|
|||||||
# Fields
|
# Fields
|
||||||
email = db.Column(db.String(254), index=True, unique=True)
|
email = db.Column(db.String(254), index=True, unique=True)
|
||||||
username = db.Column(db.String(64), index=True, unique=True)
|
username = db.Column(db.String(64), index=True, unique=True)
|
||||||
|
username_pattern = re.compile(r'^[A-Za-zÄÖÜäöüß0-9_.]*$')
|
||||||
password_hash = db.Column(db.String(128))
|
password_hash = db.Column(db.String(128))
|
||||||
confirmed = db.Column(db.Boolean, default=False)
|
confirmed = db.Column(db.Boolean, default=False)
|
||||||
member_since = db.Column(db.DateTime(), default=datetime.utcnow)
|
member_since = db.Column(db.DateTime(), default=datetime.utcnow)
|
||||||
@ -865,11 +867,13 @@ class User(HashidMixin, UserMixin, db.Model):
|
|||||||
'organization': self.organization,
|
'organization': self.organization,
|
||||||
'job_status_mail_notification_level': \
|
'job_status_mail_notification_level': \
|
||||||
self.setting_job_status_mail_notification_level.name,
|
self.setting_job_status_mail_notification_level.name,
|
||||||
|
'profile_privacy_settings': {
|
||||||
'is_public': self.is_public,
|
'is_public': self.is_public,
|
||||||
'show_email': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_EMAIL),
|
'show_email': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_EMAIL),
|
||||||
'show_last_seen': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_LAST_SEEN),
|
'show_last_seen': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_LAST_SEEN),
|
||||||
'show_member_since': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_MEMBER_SINCE)
|
'show_member_since': self.has_profile_privacy_setting(ProfilePrivacySettings.SHOW_MEMBER_SINCE)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if backrefs:
|
if backrefs:
|
||||||
json_serializeable['role'] = \
|
json_serializeable['role'] = \
|
||||||
self.role.to_json_serializeable(backrefs=True)
|
self.role.to_json_serializeable(backrefs=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user