From b2ea7ae7a08b6aa8ac8a8595e27e478a89438a17 Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Fri, 30 Aug 2024 13:00:28 -0300 Subject: [PATCH] fix(vote): remove permissions to edit candidatures and flows --- app/org_eleicoes/votepeloclima/candidature/admin.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/org_eleicoes/votepeloclima/candidature/admin.py b/app/org_eleicoes/votepeloclima/candidature/admin.py index 85c70692..14412572 100644 --- a/app/org_eleicoes/votepeloclima/candidature/admin.py +++ b/app/org_eleicoes/votepeloclima/candidature/admin.py @@ -11,6 +11,12 @@ class CandidatureAdmin(admin.ModelAdmin): def has_add_permission(self, request): return False + + def has_change_permission(self, request, obj=None): + return False + + def has_delete_permission(self, request, obj=None): + return False class CandidatureFlowAdminForm(EntangledModelForm): @@ -87,6 +93,12 @@ def political_party(self, obj): def has_add_permission(self, request): return False + + def has_change_permission(self, request, obj=None): + return False + + def has_delete_permission(self, request, obj=None): + return False admin.site.register(Candidature, CandidatureAdmin)