1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 18:08:21 +02:00

Fix permissions to lock our own note

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
2021-12-13 18:27:24 +01:00
parent 9c8ea2cd41
commit 2f28e34cec
2 changed files with 3 additions and 3 deletions

View File

@ -174,7 +174,7 @@ class UserDetailView(ProtectQuerysetMixin, LoginRequiredMixin, DetailView):
modified_note = NoteUser.objects.get(pk=user.note.pk)
# Don't log these tests
modified_note._no_signal = True
modified_note.is_active = True
modified_note.is_active = False
modified_note.inactivity_reason = 'manual'
context["can_lock_note"] = user.note.is_active and PermissionBackend\
.check_perm(self.request, "note.change_noteuser_is_active", modified_note)