Make it possible for users to lock their profiles on the profile editing page

This commit is contained in:
Gergely Polonkai 2018-07-12 12:17:18 +02:00
parent 2b1378310a
commit 9b01431641
2 changed files with 7 additions and 0 deletions

View File

@ -343,9 +343,11 @@ class ProfileForm(FlaskForm):
""" """
display_name = StringField(label=_('Display name'), validators=[DataRequired()]) display_name = StringField(label=_('Display name'), validators=[DataRequired()])
locked = BooleanField(label=_('Lock profile'))
def __init__(self, profile, *args, **kwargs): def __init__(self, profile, *args, **kwargs):
kwargs.update({'display_name': profile.display_name}) kwargs.update({'display_name': profile.display_name})
kwargs.update({'locked': profile.locked})
FlaskForm.__init__(self, *args, **kwargs) FlaskForm.__init__(self, *args, **kwargs)
self.profile = profile self.profile = profile

View File

@ -12,6 +12,11 @@
{{ form.display_name }} {{ form.display_name }}
<br> <br>
{{ form.locked.errors }}
{{ form.locked.label }}
{{ form.locked}}
<br>
<button type="submit">{% trans %}Save{% endtrans %}</button> <button type="submit">{% trans %}Save{% endtrans %}</button>
</form> </form>
{% endblock content %} {% endblock content %}