From 9b014316412025bb322d1c2588bdc41a01cec6fa Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Thu, 12 Jul 2018 12:17:18 +0200 Subject: [PATCH] Make it possible for users to lock their profiles on the profile editing page --- calsocial/forms.py | 2 ++ calsocial/templates/profile-edit.html | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/calsocial/forms.py b/calsocial/forms.py index 3ba1614..ac90df5 100644 --- a/calsocial/forms.py +++ b/calsocial/forms.py @@ -343,9 +343,11 @@ class ProfileForm(FlaskForm): """ display_name = StringField(label=_('Display name'), validators=[DataRequired()]) + locked = BooleanField(label=_('Lock profile')) def __init__(self, profile, *args, **kwargs): kwargs.update({'display_name': profile.display_name}) + kwargs.update({'locked': profile.locked}) FlaskForm.__init__(self, *args, **kwargs) self.profile = profile diff --git a/calsocial/templates/profile-edit.html b/calsocial/templates/profile-edit.html index f84d5c1..0953be4 100644 --- a/calsocial/templates/profile-edit.html +++ b/calsocial/templates/profile-edit.html @@ -12,6 +12,11 @@ {{ form.display_name }}
+ {{ form.locked.errors }} + {{ form.locked.label }} + {{ form.locked}} +
+ {% endblock content %}