Feature: Added an account disabled page
this PR addresses issue #3153
Codecov Report
Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.
Project coverage is 78.99%. Comparing base (
638ae4f) to head (8c0f388). Report is 15 commits behind head on main.
Additional details and impacted files
Hi @RafaelJohn9, is this ready for review? Could you please rebase it? Do you mind if I do it?
uhmm yea sure @mathjazz , you can take on the issue :handshake: , sorry for the delay
hey @mathjazz, on second thoughts, lemme complete this :handshake:
hey @mathjazz , well I've configured everything correctly, issue arises in the AuthenticationMiddleware, it's weird how is_authenticated=true and is_active=false doesn't pass this middleware
Looking for a way to by pass this :handshake:
oops, well is_authenticated=False && is_active=False works so yeah :smile:
The back-end test failure should be unrelated. You will need to rebase once the test is fixed.
The back-end test failure should be unrelated. You will need to rebase once the test is fixed.
okay :+1:
@RafaelJohn9 Thanks for addressing the review comments!
This patch doesn't work as expected locally, because if the is_active field is False, the user won't be authenticated during the request lifecycle, and user.is_authenticated will always be False. See the docs for more details.
We use a different authentication backend on stage / prod, which already serves inactive accounts with the account_inactive.html page after they try to log in. Sorry for not noticing this earlier!
I suggest we drop the middleware changes (incl. the test) as they are not necessary, and override the default template used by django-allauth (see https://github.com/mozilla/pontoon/tree/main/pontoon/base/templates/django). Note that these need to be Django, rather than jinja2 templates.
Closing due to inactivity, please re-open if you want to continue. Thanks for the effort so far!