disable form of user profile
This commit is contained in:
parent
35d7f014be
commit
7096e97c39
|
@ -31,11 +31,6 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
{% bootstrap_form form %}
|
||||
<div class="form-actions-no-box">
|
||||
<a class="btn btn-secondary" href="{% url 'idhub:user_profile' %}">{% translate "Cancel" %}</a>
|
||||
<input class="btn btn-success" type="submit" name="submit" value="{% translate 'Save' %}" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<hr />
|
||||
|
||||
|
|
|
@ -47,6 +47,16 @@ class ProfileView(MyProfile, UpdateView):
|
|||
def get_object(self):
|
||||
return self.request.user
|
||||
|
||||
def get_form(self):
|
||||
form = super().get_form()
|
||||
form.fields['first_name'].disabled = True
|
||||
form.fields['last_name'].disabled = True
|
||||
form.fields['email'].disabled = True
|
||||
return form
|
||||
|
||||
def form_valid(self, form):
|
||||
return super().form_valid(form)
|
||||
|
||||
|
||||
class RolesView(MyProfile, TemplateView):
|
||||
template_name = "idhub/user/roles.html"
|
||||
|
|
Loading…
Reference in a new issue