forked from gergely/calendar-social
Make it possible for users to lock their profiles on the profile editing page
This commit is contained in:
parent
2b1378310a
commit
9b01431641
@ -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
|
||||||
|
@ -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 %}
|
||||||
|
Loading…
Reference in New Issue
Block a user