From 8359a98fdd0654a2b6d4e081d26e5e6a0abaa49e Mon Sep 17 00:00:00 2001 From: Kumi Date: Fri, 12 Aug 2022 16:50:58 +0000 Subject: [PATCH] Do not reuse consent --- frontend/views/clients.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/views/clients.py b/frontend/views/clients.py index fcb020a..7729099 100644 --- a/frontend/views/clients.py +++ b/frontend/views/clients.py @@ -43,12 +43,16 @@ class ClientCreateView(TimeoutMixin, TitleMixin, CreateView): return get_object_or_404(Client, owner=self.request.user, client_id=self.kwargs["pk"]) def form_valid(self, form): - self.object = form.save(commit=False) + self.object = form.save(commit=False) - self.object.owner = self.request.user - self.object.save() + self.object.owner = self.request.user - return super().form_valid(form) + # Re-request consent (i.e. display authorization page) every time + self.object.reuse_consent = False + + self.object.save() + + return super().form_valid(form) def get_success_url(self): return reverse_lazy("frontend:client_edit", args=(self.object.client_id,)) \ No newline at end of file