Removed editing of full name from Cloud profile

We take the full name from Blender ID instead.
This commit is contained in:
2017-12-07 17:31:26 +01:00
parent 785145e1c1
commit ca25078b30
3 changed files with 11 additions and 15 deletions

View File

@@ -23,13 +23,10 @@ def profile():
api = system_util.pillar_api()
user = User.find(current_user.objectid, api=api)
form = forms.UserProfileForm(
full_name=user.full_name,
username=user.username)
form = forms.UserProfileForm(username=user.username)
if form.validate_on_submit():
try:
user.full_name = form.full_name.data
user.username = form.username.data
user.update(api=api)
flash("Profile updated", 'success')

View File

@@ -24,14 +24,13 @@ class UserLoginForm(Form):
class UserProfileForm(Form):
full_name = StringField('Full Name', validators=[DataRequired(), Length(
min=3, max=128, message="Min. 3 and max. 128 chars please")])
username = StringField('Username', validators=[DataRequired(), Length(
min=3, max=128, message="Min. 3, max. 128 chars please"), Regexp(
r'^[\w.@+-]+$', message="Please do not use spaces")])
def __init__(self, csrf_enabled=False, *args, **kwargs):
super().__init__(csrf_enabled=csrf_enabled, *args, **kwargs)
self.user = None
def validate(self):
rv = super().validate()