fix duplicated functions

This commit is contained in:
Cayo Puigdefabregas 2024-01-20 15:53:10 +01:00
parent 79b53aaa1f
commit a4e6e42d34
1 changed files with 4 additions and 14 deletions

View File

@ -29,28 +29,18 @@ class UserView(LoginRequiredMixin):
] ]
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
self.admin_validated = cache.get("KEY_DIDS")
response = super().get(request, *args, **kwargs) response = super().get(request, *args, **kwargs)
url = self.check_gdpr() url = self.check_gdpr()
if url:
return url
return response return url or response
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
self.admin_validated = cache.get("KEY_DIDS")
response = super().post(request, *args, **kwargs) response = super().post(request, *args, **kwargs)
url = self.check_gdpr() url = self.check_gdpr()
if url:
return url
return response return url or response
def get(self, request, *args, **kwargs):
self.admin_validated = cache.get("KEY_DIDS")
return super().get(request, *args, **kwargs)
def post(self, request, *args, **kwargs):
self.admin_validated = cache.get("KEY_DIDS")
return super().post(request, *args, **kwargs)
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs) context = super().get_context_data(**kwargs)