Profile view permissions
This commit is contained in:
parent
832d85b7fc
commit
d10ba90b4d
2 changed files with 7 additions and 4 deletions
|
@ -10,10 +10,10 @@
|
|||
<td>
|
||||
{{ form.instance.name }}
|
||||
{% if has_change_permission %}
|
||||
<button class="btn btn-primary"
|
||||
hx-get="{{ request.path }}?fragment=org-name-edit&hx-single-field=name"
|
||||
hx-target="closest td"
|
||||
hx-swap="outerHTML">{% translate "Edit" %}</button>
|
||||
<button class="btn btn-primary"
|
||||
hx-get="{{ request.path }}?fragment=org-name-edit&hx-single-field=name"
|
||||
hx-target="closest td"
|
||||
hx-swap="outerHTML">{% translate "Edit" %}</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endpartialdef org-name %}
|
||||
|
|
|
@ -19,6 +19,9 @@ class ProfileView(HtmxUpdateView):
|
|||
fragments = ("user-email", "user-email-edit", "user-company", "user-company-edit")
|
||||
model = User
|
||||
|
||||
def has_permission(self):
|
||||
return True
|
||||
|
||||
def get_object(self):
|
||||
return self.request.user
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue