Skip to content

Commit

Permalink
Mixin: check that siae_id is numeric
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Sep 14, 2023
1 parent 052e88b commit 777fb98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lemarche/utils/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 777fb98

Please sign in to comment.