feat: Add a 403 and 429 handler.
See context here: https://django-ratelimit.readthedocs.io/en/latest/cookbook/429.html#context For now we continue to fall back to django's default 403 handler for 403 but provide a new 429 template that we use for ratelimit exceptions. This commit also updates a logistration test that relied on the old 403 behavior of django-ratelimit instead of the newly added 429 behavior.
This commit is contained in:
@@ -137,7 +137,7 @@ class LoginAndRegistrationTest(ThirdPartyAuthTestMixin, UrlResetMixin, ModuleSto
|
||||
|
||||
# then the rate limiter should kick in and give a HttpForbidden response
|
||||
response = self.client.get(login_url)
|
||||
self.assertEqual(response.status_code, 403)
|
||||
self.assertEqual(response.status_code, 429)
|
||||
|
||||
# now reset the time to 6 mins from now in future in order to unblock
|
||||
reset_time = datetime.now(UTC) + timedelta(seconds=361)
|
||||
|
||||
Reference in New Issue
Block a user