-
Notifications
You must be signed in to change notification settings - Fork 13
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
Schedule report tasks and add report preview view #1620
base: develop
Are you sure you want to change the base?
Conversation
e64f108
to
d529a7a
Compare
email = person_data.pop("email") or generate_fake_email( | ||
f"{person_data['first_name']} {person_data['last_name']}" | ||
) | ||
if not (user := User.objects.filter(email=email).first()): |
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.
nitpick: the brackets here probably aren't needed?
|
||
return handled_commits | ||
|
||
|
||
def check_credentials() -> list[str]: |
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.
Small thing to think about rather than a blocker. I'm not sure about the naming of this. I think it could be something more intuitive maybe. The first impression from the use later would be that check_credentials
would return a bool. Maybe something like list_missing_credentials
would be more intuitive?
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'm not set on that name either if you can think of something better.
|
||
|
||
@method_decorator(staff_member_required, name="get") | ||
class ReportPreviewView(View): |
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.
Is it worth using the BoostVersionMixin here to have centralized handling of that for consistency.
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.
A few minor comments, mostly looks good. Approved.
/releases/<version_slug>/report
Note: I have not implemented PDF rendering.
I can do so, but wanted to have some discussion about what library to use. I've used WeasyPrint in the past, and the results have been good, though I recall the dev experience being annoying (someone on the team was always having to install some supporting thing on their machine).Update: I attempted to get PDF rendering working with weasyprint. The results were close but I could not get some of the styling to work. In agreement with Rob, we're going to move forward with this html-only version for now, since it takes a lot of the manual work out already. We can revisit programmatic PDF rendering in the future.
Fixes #1603