-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify static files and remove login manager #370
base: develop
Are you sure you want to change the base?
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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