Removed editing of full name from Cloud profile
We take the full name from Blender ID instead.
This commit is contained in:
@@ -23,13 +23,10 @@ def profile():
|
|||||||
api = system_util.pillar_api()
|
api = system_util.pillar_api()
|
||||||
user = User.find(current_user.objectid, api=api)
|
user = User.find(current_user.objectid, api=api)
|
||||||
|
|
||||||
form = forms.UserProfileForm(
|
form = forms.UserProfileForm(username=user.username)
|
||||||
full_name=user.full_name,
|
|
||||||
username=user.username)
|
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
try:
|
try:
|
||||||
user.full_name = form.full_name.data
|
|
||||||
user.username = form.username.data
|
user.username = form.username.data
|
||||||
user.update(api=api)
|
user.update(api=api)
|
||||||
flash("Profile updated", 'success')
|
flash("Profile updated", 'success')
|
||||||
|
@@ -24,14 +24,13 @@ class UserLoginForm(Form):
|
|||||||
|
|
||||||
|
|
||||||
class UserProfileForm(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(
|
username = StringField('Username', validators=[DataRequired(), Length(
|
||||||
min=3, max=128, message="Min. 3, max. 128 chars please"), Regexp(
|
min=3, max=128, message="Min. 3, max. 128 chars please"), Regexp(
|
||||||
r'^[\w.@+-]+$', message="Please do not use spaces")])
|
r'^[\w.@+-]+$', message="Please do not use spaces")])
|
||||||
|
|
||||||
def __init__(self, csrf_enabled=False, *args, **kwargs):
|
def __init__(self, csrf_enabled=False, *args, **kwargs):
|
||||||
super().__init__(csrf_enabled=csrf_enabled, *args, **kwargs)
|
super().__init__(csrf_enabled=csrf_enabled, *args, **kwargs)
|
||||||
|
self.user = None
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
rv = super().validate()
|
rv = super().validate()
|
||||||
|
@@ -11,13 +11,6 @@
|
|||||||
.settings-form
|
.settings-form
|
||||||
form#settings-form(method='POST', action="{{url_for('settings.profile')}}")
|
form#settings-form(method='POST', action="{{url_for('settings.profile')}}")
|
||||||
.left
|
.left
|
||||||
.form-group
|
|
||||||
| {{ form.full_name.label }}
|
|
||||||
| {{ form.full_name(size=20, class='form-control') }}
|
|
||||||
| {% if form.full_name.errors %}
|
|
||||||
| {% for error in form.full_name.errors %}{{ error|e }}{% endfor %}
|
|
||||||
| {% endif %}
|
|
||||||
|
|
||||||
.form-group
|
.form-group
|
||||||
| {{ form.username.label }}
|
| {{ form.username.label }}
|
||||||
| {{ form.username(size=20, class='form-control') }}
|
| {{ form.username(size=20, class='form-control') }}
|
||||||
@@ -25,8 +18,15 @@
|
|||||||
| {% for error in form.username.errors %}{{ error|e }}{% endfor %}
|
| {% for error in form.username.errors %}{{ error|e }}{% endfor %}
|
||||||
| {% endif %}
|
| {% endif %}
|
||||||
|
|
||||||
.form-group.settings-password
|
.form-group
|
||||||
| {{ _("Change your password at") }} #[a(href="https://blender.org/id/change") Blender ID]
|
label {{ _("Full name") }}
|
||||||
|
p {{ current_user.full_name }}
|
||||||
|
.form-group
|
||||||
|
label {{ _("E-mail") }}
|
||||||
|
p {{ current_user.email }}
|
||||||
|
|
||||||
|
.form-group
|
||||||
|
| {{ _("Change your full name, email, and password at") }} #[a(href="https://blender.org/id/",target='_blank') Blender ID].
|
||||||
|
|
||||||
.right
|
.right
|
||||||
.settings-avatar
|
.settings-avatar
|
||||||
|
Reference in New Issue
Block a user