Skip to content
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

Sync upstream dec 13th #245

Closed
wants to merge 135 commits into from

Conversation

HungNgien
Copy link
Contributor

@HungNgien HungNgien commented Dec 13, 2024

<style> </style>
f8e2acd Fix scrolling to day with multiple grids  
07f684a Notify users after password change  
2ee208d Make safelinks work on custom domains  
8e2916a Update translations  
bdeae13 🗺 Update translations (Dutch)  
719f40b Fix error message on failing to add new speaker  
ef07a66 Fix breaking tests  
c648316 Fix deadline widget in event creation wizard  
81524ca Improve qrcode image position  
587ec68 Fix look of email list with very long proposals  
48a10bf Provide outbound link signing and redirects  
b1e3696 Fix custom help texts not showing in user edit  
32430bf Update look'n'feel screenshot  
e1a6c10 Fix migration dependency  
42c5807 Possibly fix new spurious test failures  
3917f13 Keep model imports late to avoid circular imports  
79ace89 Fix code style and failing tests  
4f9e4ec Add configurable speaker invite email templates  
5db8d1c Fix display of avatars in headings  
dd797f2 Allow to customise organiser proposal notifications  
0ce9c1a Code style  
59b2e41 Make iCal export available without showing in list  
3d85df2 Remove unused screenshots  
71217dd Fix use of SpeakerFilterForm  
3c53087 Allow to filter by track in email lists  
be86ec0 Move filtering to forms where sensible  
2d4b842 Correctly show number of submissions per track  
68cd571 Fix broken timezone toggle  
0f00674 Fix janky scroll behaviour in schedule  
96cd143 Add powered-by line to text schedule  
9a81803 Fix duplicate translation strings  
e36011c Consistent English spelling of email  
ba32d10 🗺 Update translations (Czech)  
91e7ce9 Fix HTML export.  
6c7aa16 Hide unused rooms on a day-by-day basis  
5221bb9 Make sure dropdowns don’t wrap indicator  
e622bab Add big button for organiser area if allowed  
b38f375 Redirect to current page after event login  
274be63 Don’t hide language select and login  
a4a5923 Improve display of public questions  
af0a454 Move import to make test runner happy  
f8f64a5 Fix incorrectly escaped ampersand in drop-downs  
521d5c4 Fix access of new email list structure  
65c15ad Fix breaking tests  
95c1bba Fix email submission link some more  
72078ac Fix bug in email submission mapping  
14be2d5 Don’t updae last_login in tests  
f68e450 Fix and document (most of) automated screenshots  
c3a9a19 Allow to send/discard filtered outbox list  
22d952f Make dropdown colour transition smoother  
89c2797 Log out only on POST  
2545da7 Fix link to organiser dashboard  
1dafd98 Show proposals in email list  
5c117f1 Update translations  
7c22564 Fix new Django warning  
7b40447 Use tabs in email editor  
efcba1a Fix placeholder insertion  
4b2e190 Fix incorrect widget generation  
d92c540 Render text after pre_send has run ignore errors
21107a9 Link notification proposals to emails  
6906c62 Reword changelog and docs  
0827ebe Add signal queuedmail_post_send.  
241ccac Store submission references in queued mails from orga forms  
47e2f88 Add submissions to outgoing mails to facilitate plugin integrations.  
01e6bdb 🗺 Update translations (Czech)  
27ac039 🗺 Update translations (Vietnamese)  
2ee0618 🗺 Update translations (Russian)  
66dae8b Fix Python 3.10 support  
2d12d0e Remove weird full_submission_content interface  
981194a Remove useless assert  
5a54190 Initialize variables clearly  
455d044 Don’t use deprecated utcnow()  
3762d3c Don’t name unused variables  
3f7fa4e Add sane default pyright config  
2731f88 Code style  
cefd902 Allow to export datetimes as two separate IDs  
ee47a79 Send submission_state_change signal on create  
77a6b95 Fix breaking tests due to env pollution  
869f99d Mark CSRF cookie as secure  
8f15c24 Improve HTML export speed and reliability  
d320fc9 Fix invisible badges/indicators  
1a6b1f5 Fix code style  
2aed9e5 Allow to use the schedule widget for selected days  
08f5267 Fix session display bug  
49d6cb9 Update schedule.js to fix break bug  
583292a Bump bleach  
98b0b6e Fix immovable active tab indicator in schedule  
47d1ba8 Fix schedule being always in English  
f3ccfee Stop the active review phase deletion  
d94397d Make sure review phases are always ordered  
0b51428 Fix drag'n'drop in Chrome  
45d50bb Improve print.css slightly  
d135282 Bump redis and whitenoise  
d1d5d0b Fix HTML export  
52144aa Truncate very long file names  
e04057d Fix spelling  
35ab81c Use localised start time in exporter  
e030ee0 Stop expanding colours while users are typing  
e9439ff Colour top nav in current event’s colour  
f20e206 Show state badge instead of dropdown to reviewers  
d6373c7 Some tests seem to actually need the reruns  
ffecc28 Bump development version  
55d1ccc Release v2024.3.1  
78396de Query counts in tests are a joy  
9ef2fb0 Sigh breaking test once more
2be1c9d Move speaker links below organiser event list  
a803f8d Fix breaking test  
8c6c9af Install deps with uv for speedup  
7ca4369 Fix breaking tests  
6ca1683 Stop using pytest-rerunfailures  
c2f29a2 Fix test  
b0d70c5 Fix test  
9a1571e Make sure apt runs non-interactively  
29f736d Use postgres as service rather than as sub-action  
7b5c3e6 We haven’t been using Travis in ages  
e5be51b I'd rather fix flaky tests than rerun failures  
a8fa483 Fix form error  
bbde16b Code style  
ca438d1 Fix bug in submission filter form  
9a4bec4 Fix missing embed css  
c4f466f 🗺 Update translations (German (de_FORMAL))  
84fa7ae 🗺 Update translations (German)  

Summary by Sourcery

Sync with upstream changes, introducing a new mail template role system, improving email and submission handling, and updating dependencies. Enhance the CI setup by migrating to GitHub Actions and improve test reliability. Update translations and documentation for multiple languages.

New Features:

  • Introduce a new mail template role system to manage email templates more flexibly.
  • Add support for filtering emails by track in the email list view.
  • Implement a new signal 'queuedmail_pre_send' to allow actions before sending queued mails.

Bug Fixes:

  • Fix various issues with email placeholders and template rendering.
  • Resolve issues with speaker invitation and account creation process.
  • Correctly handle submission state changes and associated notifications.

Enhancements:

  • Refactor email template management to use roles instead of fixed templates.
  • Improve the UI for managing speakers and submissions, including better form handling and validation.
  • Enhance the schedule export functionality with additional options and improved performance.

Build:

  • Update dependencies including 'bleach', 'redis', and 'whitenoise' to newer versions.

CI:

  • Switch from using Travis CI to GitHub Actions for continuous integration.
  • Improve test reliability by addressing flaky tests and removing unnecessary reruns.

Documentation:

  • Update translations for multiple languages including Czech, Dutch, and Vietnamese.

Tests:

  • Add tests for new email template roles and submission state change handling.
  • Improve test coverage for the mail system and submission workflows.

weblate and others added 30 commits December 13, 2024 17:13
Currently translated at 100.0% (1508 of 1508 strings)

Co-authored-by: Tobias Kunze <[email protected]>
Translate-URL: http://translate.pretalx.com/projects/pretalx/pretalx/de/
Translation: pretalx/pretalx
Currently translated at 100.0% (1508 of 1508 strings)

Co-authored-by: Tobias Kunze <[email protected]>
Translate-URL: http://translate.pretalx.com/projects/pretalx/pretalx/de_FORMAL/
Translation: pretalx/pretalx
rixx and others added 17 commits December 13, 2024 17:14
Currently translated at 99.7% (1508 of 1512 strings)

Co-authored-by: r spoor <[email protected]>
Translate-URL: http://translate.pretalx.com/projects/pretalx/pretalx/nl/
Translation: pretalx/pretalx
…sia#232)

* Fix join online video button after customer feature is removed

* fix pipeline, unit test

---------

Co-authored-by: odkhang <[email protected]>
* change default color for eventyay-talk and some messages

* change default color for eventyay-talk and some messages

* fix UT

---------

Co-authored-by: odkhang <[email protected]>
* Ensure SSO works on admin level and change implementation to be an external plugin

* remove unsed template

* fix pipeline

* using provider name constant instead of text

* update transaction for storing key

* handle case sso_provider not configured

---------

Co-authored-by: odkhang <[email protected]>
* Enable video plugin

* Fix black in pipeline

* Fix black in pipeline

* Add comment

* Update code

---------

Co-authored-by: odkhang <[email protected]>
Copy link

sourcery-ai bot commented Dec 13, 2024

Reviewer's Guide by Sourcery

This pull request synchronizes changes from upstream, focusing on significant architectural improvements around email templates, user management, and UI enhancements. The changes include a major refactor of the email template system, improved security features, and various bug fixes and optimizations.

Class diagram for Email Template Refactor

classDiagram
    class Event {
        +get_mail_template(role)
        +build_initial_data()
        +reorder_review_phases()
        +update_review_phase()
    }
    class MailTemplate {
        +role: MailTemplateRoles
        +to_mail(user, event, context_kwargs, skip_queue, commit, submissions, attachments)
    }
    class MailTemplateRoles {
        <<enumeration>>
        +NEW_SUBMISSION
        +NEW_SUBMISSION_INTERNAL
        +SUBMISSION_ACCEPT
        +SUBMISSION_REJECT
        +NEW_SPEAKER_INVITE
        +EXISTING_SPEAKER_INVITE
        +QUESTION_REMINDER
        +NEW_SCHEDULE
    }
    Event --> MailTemplate : uses
    MailTemplate --> MailTemplateRoles : has role
Loading

Class diagram for User Management Changes

classDiagram
    class User {
        +change_password(new_password)
        +reset_password(event, user, mail_text, orga)
    }
    class QueuedMail {
        +send(requestor, orga)
    }
    User --> QueuedMail : sends
Loading

Class diagram for Submission Changes

classDiagram
    class Submission {
        +add_speaker(email, name, locale, user)
        +send_initial_mails(person)
        +send_state_mail()
    }
    class SpeakerProfile {
    }
    Submission --> SpeakerProfile : manages
    Submission --> User : adds speaker
Loading

File-Level Changes

Change Details Files
Refactored email template system to use roles instead of fixed templates
  • Introduced MailTemplateRoles enum to define different types of email templates
  • Migrated from fixed template fields to a role-based lookup system
  • Added support for customizable speaker invitation email templates
  • Improved email template preview and editing interface
src/pretalx/mail/models.py
src/pretalx/mail/default_templates.py
src/pretalx/event/models/event.py
src/pretalx/orga/templates/orga/mails/template_list.html
Enhanced security features and user management
  • Added secure CSRF cookie settings
  • Implemented safe external link handling with confirmation page
  • Added password change notification emails
  • Changed logout to require POST request
src/pretalx/settings.py
src/pretalx/common/views/redirect.py
src/pretalx/person/models/user.py
src/pretalx/cfp/views/auth.py
Improved UI and user experience
  • Added support for filtering schedule widget by days
  • Enhanced submission state badges and display
  • Improved dropdown menu styling and behavior
  • Fixed various CSS issues and layout problems
src/pretalx/static/common/css/_dropdown.css
src/pretalx/static/orga/css/_layout.css
src/pretalx/orga/templates/orga/submission/list.html
src/pretalx/static/common/css/base.css
Optimized database queries and performance
  • Reduced number of queries in schedule views
  • Improved HTML export speed and reliability
  • Added proper ordering for review phases
  • Fixed query count issues in tests
src/pretalx/schedule/models/schedule.py
src/pretalx/agenda/management/commands/export_schedule_html.py
src/pretalx/event/models/event.py
src/tests/agenda/views/test_agenda_schedule.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@HungNgien HungNgien marked this pull request as ready for review December 16, 2024 04:34
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @HungNgien - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Setting CSRF_COOKIE_HTTPONLY to False exposes the CSRF token to XSS attacks (link)
  • Removing field.value assignment breaks color value update functionality (link)
Here's what I looked at during the review
  • 🔴 General issues: 1 blocking issue, 2 other issues
  • 🔴 Security: 1 blocking issue
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.


Your pretalx account password was just changed.

If you did not cange your password, please contact the site administration immediately.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (typo): Fix typo in password change email text

Suggested change
If you did not cange your password, please contact the site administration immediately.
If you did not change your password, please contact the site administration immediately.

if total_length > max_length:
# If the total length of the path exceeds the max length, we need to
# shorten the file name by the difference.
file_root = file_root[: -(total_length - max_length)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Add validation to ensure shortened filename is not empty

If the shortened filename would be empty, we should either raise an error or use a minimum length fallback.

@@ -160,6 +160,9 @@ def merge_csp(*options, config=None):

CSRF_COOKIE_NAME = "pretalx_csrftoken"
CSRF_TRUSTED_ORIGINS = [SITE_URL]
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = False
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 issue (security): Setting CSRF_COOKIE_HTTPONLY to False exposes the CSRF token to XSS attacks

The CSRF cookie should be httponly unless there is a specific requirement otherwise

@@ -43,7 +43,6 @@ const updateContrast = (field, color) => {
".colorpicker-preview",
).style.backgroundColor = color.hex
// We're getting RRGGBBAA, but we don't want the alpha channel
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Removing field.value assignment breaks color value update functionality

The color value needs to be updated in the field, even if we're trimming the alpha channel

@HungNgien HungNgien marked this pull request as draft December 16, 2024 05:36
@HungNgien HungNgien closed this Dec 16, 2024
@HungNgien HungNgien deleted the Sync-Upstream-Dec-13th branch December 16, 2024 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants