-
Notifications
You must be signed in to change notification settings - Fork 8
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
Stapf functions #55
base: main
Are you sure you want to change the base?
Stapf functions #55
Conversation
could you move the addition of the vendored javascript libraries into separate commit(s)? That makes the other changes easier to review. |
@fabianfreyer Commit split up. Please review |
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.
Code itself LGTM, modulo testing.
Some smaller, architectural notes: I'm not sure the account_management
system really is the right place for this, as it's becoming a big, clunky, monolith. I'm guessing that started with integrating the registration logic, which was really a hack. Originally, this application was supposed to remain a small, slim LDAP-Backed OAuth provider with some administrative views for account management. Maybe a standalone service that authenticates against the OAuth provider and uses the appropriate scopes to verify group membership and access might be more appropriate and maintainable?
Given my other feedback is mostly just nitpicking and formalities, I'm gonna recommend merging this PR (possibly adressing my other comments - that's up to you, @JanLuca) and then at some later time separating out this and the registration logic into a separate application.
file_path = db.Column(db.Text()) | ||
comment = db.Column(db.Text()) | ||
|
||
class Batch(db.Model): |
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.
Maybe a more descriptive name here might be better, e.g. MailBatch
recipients = db.relationship("Recipient", secondary=RecipientToList, backref=db.backref('lists', lazy=True)) | ||
comment = db.Column(db.Text()) | ||
|
||
class Decision(db.Model): |
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.
What exactly does a Decision
represent? Maybe we can find better naming for this class...
app/stapf/templates/decisions.html
Outdated
|
||
{% block content %} | ||
<div class="container"> | ||
<h1>Beschlüsse</h1> |
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.
We should really start using proper i18n for this..., but that's not in scope for this PR ¯_(ツ)_/¯
app/stapf/helpers.py
Outdated
@@ -29,9 +29,9 @@ def send_batch_mails(batch): | |||
msg.attach(batch.decision.filename, "application/pdf", fp.read()) | |||
conn.send(msg) | |||
|
|||
msg = Message(batch.subject, recipients=[current_app.config['MAIL_STAPF']], |
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.
Why is this being commented out? Could this be hidden behind a config variable or a check if MAIL_STAPF
is even set?
No description provided.