Simplify static files and remove login manager#370
Simplify static files and remove login manager#370sebschrader wants to merge 2 commits intodevelopfrom
Conversation
| login_manager = SipaLoginManager() | ||
| login_manager = LoginManager() | ||
| login_manager.login_view = "generic.login" | ||
| login_manager.login_message = "Bitte melde Dich an, um die Seite zu sehen." |
There was a problem hiding this comment.
I've not run the code, but self.localize_callback = gettext seems to miss compared to SipaLoginManager?
| from flask_login import LoginManager | ||
|
|
||
|
|
||
| class SipaLoginManager(LoginManager): |
There was a problem hiding this comment.
If you delete things, it's good practice to run a grep through the project so one notices superfluous usages before the CI does.
tl;dr you forgot to delete the test that's associated with that module.
|
I'm just noticing that your changes rendered the tests unusable, because they just tested the custom login manager, and not the blueprint themselves. Unfortunately, I don't have time to look into this, so you will need to fix this before I can merge. |
|
Since – judging by current observations – our user_loader exemption does not even work at the moment, we can
The decorator could look like this (analogous to the def member_required(func):
@wraps(func)
def decorated_view(*args, **kwargs):
if request.method in EXEMPT_METHODS or current_app.config.get("LOGIN_DISABLED"):
pass
elif not current_user.is_authenticated \
or current_user.is_authenticated and not current_user.is_member:
return current_app.login_manager.unauthorized()
return func(*args, **kwargs)
return decorated_view |
Simplify the restricted document handling introduced for #281 in #319 and remove the
SipaLoginManager.Please make sure though you did the following (tick off everything you
already did):
develop