Make it possible for users to lock their profiles on the profile editing page
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -12,6 +12,11 @@ | ||||
|     {{ form.display_name }} | ||||
|     <br> | ||||
|  | ||||
|     {{ form.locked.errors }} | ||||
|     {{ form.locked.label }} | ||||
|     {{ form.locked}} | ||||
|     <br> | ||||
|  | ||||
|     <button type="submit">{% trans %}Save{% endtrans %}</button> | ||||
| </form> | ||||
| {% endblock content %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user