From 777fb98160a65c455868a0760d2e593bf1f18d9d Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Thu, 14 Sep 2023 10:13:51 +0200 Subject: [PATCH] Mixin: check that siae_id is numeric --- lemarche/utils/mixins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lemarche/utils/mixins.py b/lemarche/utils/mixins.py index c082b848b..d45fee715 100644 --- a/lemarche/utils/mixins.py +++ b/lemarche/utils/mixins.py @@ -174,7 +174,7 @@ def handle_no_permission(self): class LoginRequiredOrSiaeIdParamMixin(UserPassesTestMixin): def test_func(self): siae_id = self.request.GET.get("siae_id", None) - return self.request.user.is_authenticated or siae_id + return self.request.user.is_authenticated or (siae_id and siae_id.isnumeric()) def handle_no_permission(self): return LoginRequiredUserPassesTestMixin.dispatch(self, self.request)