Removed editing of full name from Cloud profile
We take the full name from Blender ID instead.
This commit is contained in:
parent
785145e1c1
commit
ca25078b30
@ -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')
|
||||
|
@ -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()
|
||||
|
@ -11,13 +11,6 @@
|
||||
.settings-form
|
||||
form#settings-form(method='POST', action="{{url_for('settings.profile')}}")
|
||||
.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.username.label }}
|
||||
| {{ form.username(size=20, class='form-control') }}
|
||||
@ -25,8 +18,15 @@
|
||||
| {% for error in form.username.errors %}{{ error|e }}{% endfor %}
|
||||
| {% endif %}
|
||||
|
||||
.form-group.settings-password
|
||||
| {{ _("Change your password at") }} #[a(href="https://blender.org/id/change") Blender ID]
|
||||
.form-group
|
||||
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
|
||||
.settings-avatar
|
||||
|
Loading…
x
Reference in New Issue
Block a user