Skip to content

Conversation

@Rotheem
Copy link
Member

@Rotheem Rotheem commented Jun 13, 2025

Description

Please explain the changes you made here.

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the documentation, if necessary

@codecov
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 79.10448% with 14 lines in your changes missing coverage. Please review.

Project coverage is 85.21%. Comparing base (efd9863) to head (1ca5444).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
app/core/utils/config.py 53.33% 7 Missing ⚠️
app/dependencies.py 76.47% 4 Missing ⚠️
app/types/exceptions.py 71.42% 2 Missing ⚠️
app/core/payment/payment_tool.py 92.85% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
- Coverage   85.27%   85.21%   -0.07%     
==========================================
  Files         163      163              
  Lines       11514    11553      +39     
==========================================
+ Hits         9819     9845      +26     
- Misses       1695     1708      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Rotheem Rotheem requested a review from Copilot June 16, 2025 10:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds support for multiple HelloAsso configurations by introducing a HelloAssoConfigName enum, a HELLOASSO_CONFIGURATIONS setting list, and updating the payment tool and dependencies to select the correct configuration by name.

  • Introduce HelloAssoConfigName and HelloAssoConfig model
  • Refactor Settings to parse multiple configurations and validate names
  • Update get_payment_tool dependency to return a named tool instance
  • Update PaymentTool to accept a single HelloAssoConfig and remove per-slug parameters
  • Adjust tests and endpoints to use the new multi-config setup

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_payment.py Refactored tests to use HelloAssoConfigName and override fn
tests/conftest.py Dependency overrides updated per config name
tests/commons.py MockedPaymentTool and override signature updated
app/types/exceptions.py Added DotenvInvalidHelloAssoConfigNameError
app/modules/raid/endpoints_raid.py Switched to Depends(get_payment_tool(HelloAssoConfigName.RAID))
app/modules/cdr/endpoints_cdr.py Switched to Depends(get_payment_tool(HelloAssoConfigName.CDR))
app/dependencies.py Refactored get_payment_tool to support multiple configs
app/core/utils/config.py Added HELLOASSO_CONFIGURATIONS and PARSED_HELLOASSO_CONFIGURATIONS
app/core/payment/types_payment.py Defined HelloAssoConfigName enum and HelloAssoConfig model
app/core/payment/payment_tool.py Updated constructor to take HelloAssoConfig
app/core/myeclpay/endpoints_myeclpay.py Switched to Depends(get_payment_tool(HelloAssoConfigName.MYECLPAY))
.env.test Replaced single slugs with an empty HELLOASSO_CONFIGURATIONS and set HELLOASSO_API_BASE
Comments suppressed due to low confidence (3)

app/core/payment/payment_tool.py:42

  • Attribute _hello_asso_api_base is inconsistent with _helloasso_slug. Consider renaming to _helloasso_api_base for consistent naming.
_hello_asso_api_base: str

app/core/utils/config.py:340

  • Add a test case for invalid entries in HELLOASSO_CONFIGURATIONS to verify that DotenvInvalidHelloAssoConfigNameError is raised as expected.
if name not in HelloAssoConfigName._member_names_:

app/core/utils/config.py:320

  • The decorator @cached_property is used but not imported. Add from functools import cached_property to avoid a NameError at runtime.
@cached_property

Copy link
Member

@armanddidierjean armanddidierjean left a comment

Choose a reason for hiding this comment

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

Great PR. Thanks

_helloasso_slug: str

_hello_asso_api_base: str | None = None
_redirection_uri: str | None = None
Copy link
Member

Choose a reason for hiding this comment

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

Instead of an optional _redirection_uri, I would suggest having a list _allowed_redirection_uri. When we would initiate a checkout, we would ensure that the redirect_uri passed by the front is allowed

@Rotheem Rotheem force-pushed the feat/support-multiple-helloasso-configuration branch from 8b110b7 to ced5020 Compare June 25, 2025 12:15
@armanddidierjean armanddidierjean force-pushed the feat/support-multiple-helloasso-configuration branch from c7b1b0b to 1ca5444 Compare June 26, 2025 15:31
@armanddidierjean armanddidierjean merged commit 52854b2 into main Jun 26, 2025
8 checks passed
@armanddidierjean armanddidierjean deleted the feat/support-multiple-helloasso-configuration branch June 26, 2025 15:39
Rotheem added a commit to ProximApp/Hyperion that referenced this pull request Aug 24, 2025
* Set REFRESH_TOKEN_EXPIRE_MINUTES to 60 days (aeecleclair#753)

* raid-registering: Generate PDF from HTML template with weasyprint (aeecleclair#739)

### Description

Generate PDF using Jinja templates and WeasyPrint.

We use:
 - PyMuPDF for PDF manipulation, and conversion between image and PDF
 - WeasyPrint for PDF generation from HTML

We remove fpdf2 which html engine was too simple for complex templates

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* feat: support multiple HelloAsso configurations (aeecleclair#750)

### Description

Please explain the changes you made here.

### Checklist

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Accept all schools accounts for WikijsAuthClient (aeecleclair#752)

* MyECLPay: use new CalypSSO UI for text assets (aeecleclair#763)

### Description

The link in the mail asserting you signed the ToS now brings to a less
austere page.

### Checklist

- [x] Bump CalypSSO to 2.2.0
- [x] Update mail link
  - [x] Use CalypSSO methods to build the URL

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Hyperion 4.6.0 (aeecleclair#762)

* Admin endpoint to send notification to group (aeecleclair#765)

* Hyperion configuration using yaml file (aeecleclair#756)

### Description

Hyperion will try to load its configuration, using, by precedence:
 - environment variables
 - .env.yaml file
 - .env file

* Allow to configure AuthClients using a dictionnary (aeecleclair#757)

instead of a list of list

This PR introduce a breaking change
Requires aeecleclair#756

* Acquire a lock before running initialization steps (aeecleclair#768)

### Description

If multiple workers are detected, and a Redis client, Hyperion will
raise an error.
Otherwise the server won't be able to:
 - run initialization steps
 - send messages over WebSocket reliably.

The logic is extracted from the great aeecleclair#375

---------

Co-authored-by: Thonyk <timr.web@free.fr>
Co-authored-by: Timothée Robert <114694873+Rotheem@users.noreply.github.com>

* Refactor app state using dependencies and state (aeecleclair#769)

### Description

Instead of initiating objects like redis client or db connection when
the dependency is called for the first time, we
create a dedicated `init_app_state` dependency to initialize all these
objects. These objects are stored in the application state instead of
global variables.

This ensures that an object may not be reused in another Hyperion app
instance, which would have its own event loop. This previously caused
issues for tests

Requires aeecleclair#768

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* Use an existing default file for raid rules (aeecleclair#771)

* Removed old init.py (aeecleclair#773)

### Description

Please explain the changes you made here.

### Checklist

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Notification topics refactorization using a db table (aeecleclair#680)

Change completely the structure of topics in Hyperion. Instead of using
an Enum difficult to edit, we have a table in db with all existing
topics.

This allows to ensure that users can only subscribe to *real* topics. 
Topics can be created either in the module definition (ex: `cinema`), or
using a utils from an endpoint (creation of a new topic each time we
create an advertiser in `announce`). Topics can now be restricted to a
specific group.

By default, all users are subscribed to each topic, they can unsubscribe
manually if they want.

A change in the frontend is required:
 - using `/notification/topics` the client will get all available topics
 - it could be nice to group topics by `module_root`

This PR will reset existing subscriptions. All users will be subscribed
to all topics, except for `advert`

Fix aeecleclair#479
Requires aeecleclair#768

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Optional HA api-base (aeecleclair#774)

* Only hash a global password for all test users (aeecleclair#776)

as hashing password is a time consuming operation. We expect a 2 min
gain over our test suite.

* Dotenv for Docker variables in addition to yaml config file (aeecleclair#778)

### Description

Please explain the changes you made here.

### Checklist

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Feat : Add base to allow factory setup (aeecleclair#375)

Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>

* Change Dockerfile entrypoint to adapt new env_file parameter (aeecleclair#781)

### Description

Please explain the changes you made here.

### Checklist

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Invert logic for unlock_key (aeecleclair#782)

### Description

Please explain the changes you made here.

### Checklist

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Allow to restrict registration to invited users (#6)

* Allow to restrict registration to invited users

* Add user to default_group on activation

* Invite users

* Queued emails

* Lint

* Cron for send mail task

* Lint

* Pass args directly instead of model in cruds

* Test batch invite user

* Docstring

* Don't send emails if the address is empty

* Only remove send mails from the queue

* Only send 100 email per hours

* Calypsso 2.3.0

* Fix

* Fixup

* Migration

* Lint

* Format

* Optional default_group_id

* Comment

* PROXI-54: modular association groupements (#9)

* feat: use modular association groupements

* typo

* fix: adapt factories to new system

* fix: rebase

* feat: change default logo

* fix: rebase

* fix: correct worker count when using --worker option (#10)

* School configuration (#7)

* Add user to default_group on activation

* Configurable email regex

* Configurable email regex

* Parametrize application name

* Configure the email regex directly in settings

* Rename centrale_lyon to this_school

* Import Pattern from re

* Use simple quotes for regex

* base_school

* Rename base_school in test

* Migration

* Self registration in config template

* Serve color and name of the project

* Remove unused css file and fix yaml template

* pydantic-extra-types==2.10.5

* Entity name

* Remove unused imports

* Rename is_user_a_school_member

* Rename get_school_account_types

* Rename is_user_an_ecl_member

* Documentation

* Lint

* Rename is_user_a_school_member

* fixup

* Remove unused code

* Validate users

* fix: rebase

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* PROXI-61: rename payment files (#11)

* feat: rename payment part

* feat: rename tables

* fix: rebase

* feat: change routes

* fix: test

* Fix(state management): store state in global variable to allow the scheduler to access db (#8)

* Fix user batch invitation response model

* Fix: add missing param in send_emails_from_queue_task

* Get db directly using SessionLocal

* Store state in global Python variable

* Use arq 0.26.3

* Don't keep arq job results after completion

to be able to queue new jobs with the same id

* Cancel planned notification with the same job_id

before queuing a new one

* fixup state

* Access GLOBAL_STATE in tests init

* Remove unexpected state param while disconnecting

* Lint

* Parametrize test_factory fixture

* Lint

* Refactor test settings

* Lint

* Return email placeholder in variables (#15)

* Feed and feed from advert (#4)

* Feed

* Image endpoint and location and action fields

* Lint

* fix: rebase

* Add a logo for groups

* Feed: rename image_folder to image_directory

* Advert post to feed and remove tag

* Fix rebase

* Lint and migration

* Rebase migration

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* CoreAssociation (#13)

* CoreAssociation

# Conflicts:
#	app/utils/tools.py

* Migration

* Rebase migration

* Rename migration file 40 to 41 (#16)

* remove tags in update model (#17)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: circular import on windows (#20)

* remove status in admin query (#21)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Super admin (#22)

* feat: add super admin attribute

* feat: remove admin bypass

* fix: tests

* super user in factory (#23)

* super user in factory

* copilot this fyot

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Add for front (#24)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* PROXI-71: patch legal texts on request and update them (#12)

* feat: patch legals text on request

# Conflicts:
#	app/core/utils/config.py
#	config.template.yaml

* feat: add end of support

* fix: typo

* Account deletion

* Apply suggestions from code review

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>

* fixes

* add email_placeholder to school

* fix config.yaml

* Fix indentation

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor Calendar to use associations and feed (#14)

* Refactor Calendar to use associations and feed

* Lint

* Migration

* Fix calendar factory condition

* Add a daylong event in calendar factory

* ical: use date for daylong events

instead of datetime

* Parametrize ical id

* Ticket url

* lint

* bump revision number

* remove description

* add post feed image

* fix : add image directory

* fix : use image id

* update factory

* admin id from GroupType enum

* post feed image in calendar

* Event image

* Lint

* Test

* fixup

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor advert to use associations (#18)

* Refactor Calendar to use associations and feed

* Migration

* Refactor advert to use associations

* fixup

* Migration

* Rebase migration

* rebase migration

* CalypSSO 2.4.0 (#25)

* typo (#26)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* typo (#29)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: replace placeholder in tos (#30)

* fix: replace placeholder in tos

* feat: prevent event with ticket and missing ticket field

* fix: typo

* feat: add tests

* PROXI 79: mypayment multi structure (#19)

* feat: add mypayment invoices

* fix: clean up

* Export PDF documentation

* Fix migration

* fix: typo

* fix: use structure as bank account holder

* fix: add missing config.template

* fix: extend s3 directory null check to empty string

* feat: add mypayment factory

* fix: rebase and correct factory

* fix: typo

* fix: missing function call

* fix: invoice pdf data

* fix: typo

* fix: use utils

* feat: add delay penalty

* fix: tests and rebase

* fix: move dependency

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Fix MyPayment Invoices (#33)

* fix: apply suggestions

* fix: typo

* fix: remove useless schema

* fix: typo

* Don't raise when feed picture does not exist and create data/campaigns folder at launch (#32)

* Don't raise when feed picture does not exist

but return an HTTPException

* Create data/campaigns folder at launch

---------

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Marc-Andrieu <146140470+Marc-Andrieu@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+foucblg@users.noreply.github.com>
Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>
Rotheem added a commit to ProximApp/Hyperion that referenced this pull request Aug 25, 2025
* Set REFRESH_TOKEN_EXPIRE_MINUTES to 60 days (aeecleclair#753)

* raid-registering: Generate PDF from HTML template with weasyprint (aeecleclair#739)

Generate PDF using Jinja templates and WeasyPrint.

We use:
 - PyMuPDF for PDF manipulation, and conversion between image and PDF
 - WeasyPrint for PDF generation from HTML

We remove fpdf2 which html engine was too simple for complex templates

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* feat: support multiple HelloAsso configurations (aeecleclair#750)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Accept all schools accounts for WikijsAuthClient (aeecleclair#752)

* MyECLPay: use new CalypSSO UI for text assets (aeecleclair#763)

The link in the mail asserting you signed the ToS now brings to a less
austere page.

- [x] Bump CalypSSO to 2.2.0
- [x] Update mail link
  - [x] Use CalypSSO methods to build the URL

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Hyperion 4.6.0 (aeecleclair#762)

* Admin endpoint to send notification to group (aeecleclair#765)

* Hyperion configuration using yaml file (aeecleclair#756)

Hyperion will try to load its configuration, using, by precedence:
 - environment variables
 - .env.yaml file
 - .env file

* Allow to configure AuthClients using a dictionnary (aeecleclair#757)

instead of a list of list

This PR introduce a breaking change
Requires aeecleclair#756

* Acquire a lock before running initialization steps (aeecleclair#768)

If multiple workers are detected, and a Redis client, Hyperion will
raise an error.
Otherwise the server won't be able to:
 - run initialization steps
 - send messages over WebSocket reliably.

The logic is extracted from the great aeecleclair#375

---------

Co-authored-by: Thonyk <timr.web@free.fr>
Co-authored-by: Timothée Robert <114694873+Rotheem@users.noreply.github.com>

* Refactor app state using dependencies and state (aeecleclair#769)

Instead of initiating objects like redis client or db connection when
the dependency is called for the first time, we
create a dedicated `init_app_state` dependency to initialize all these
objects. These objects are stored in the application state instead of
global variables.

This ensures that an object may not be reused in another Hyperion app
instance, which would have its own event loop. This previously caused
issues for tests

Requires aeecleclair#768

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* Use an existing default file for raid rules (aeecleclair#771)

* Removed old init.py (aeecleclair#773)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Notification topics refactorization using a db table (aeecleclair#680)

Change completely the structure of topics in Hyperion. Instead of using
an Enum difficult to edit, we have a table in db with all existing
topics.

This allows to ensure that users can only subscribe to *real* topics.
Topics can be created either in the module definition (ex: `cinema`), or
using a utils from an endpoint (creation of a new topic each time we
create an advertiser in `announce`). Topics can now be restricted to a
specific group.

By default, all users are subscribed to each topic, they can unsubscribe
manually if they want.

A change in the frontend is required:
 - using `/notification/topics` the client will get all available topics
 - it could be nice to group topics by `module_root`

This PR will reset existing subscriptions. All users will be subscribed
to all topics, except for `advert`

Fix aeecleclair#479
Requires aeecleclair#768

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Optional HA api-base (aeecleclair#774)

* Only hash a global password for all test users (aeecleclair#776)

as hashing password is a time consuming operation. We expect a 2 min
gain over our test suite.

* Dotenv for Docker variables in addition to yaml config file (aeecleclair#778)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Feat : Add base to allow factory setup (aeecleclair#375)

Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>

* Change Dockerfile entrypoint to adapt new env_file parameter (aeecleclair#781)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Invert logic for unlock_key (aeecleclair#782)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Allow to restrict registration to invited users (#6)

* Allow to restrict registration to invited users

* Add user to default_group on activation

* Invite users

* Queued emails

* Lint

* Cron for send mail task

* Lint

* Pass args directly instead of model in cruds

* Test batch invite user

* Docstring

* Don't send emails if the address is empty

* Only remove send mails from the queue

* Only send 100 email per hours

* Calypsso 2.3.0

* Fix

* Fixup

* Migration

* Lint

* Format

* Optional default_group_id

* Comment

* PROXI-54: modular association groupements (#9)

* feat: use modular association groupements

* typo

* fix: adapt factories to new system

* fix: rebase

* feat: change default logo

* fix: rebase

* fix: correct worker count when using --worker option (#10)

* School configuration (#7)

* Add user to default_group on activation

* Configurable email regex

* Configurable email regex

* Parametrize application name

* Configure the email regex directly in settings

* Rename centrale_lyon to this_school

* Import Pattern from re

* Use simple quotes for regex

* base_school

* Rename base_school in test

* Migration

* Self registration in config template

* Serve color and name of the project

* Remove unused css file and fix yaml template

* pydantic-extra-types==2.10.5

* Entity name

* Remove unused imports

* Rename is_user_a_school_member

* Rename get_school_account_types

* Rename is_user_an_ecl_member

* Documentation

* Lint

* Rename is_user_a_school_member

* fixup

* Remove unused code

* Validate users

* fix: rebase

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* PROXI-61: rename payment files (#11)

* feat: rename payment part

* feat: rename tables

* fix: rebase

* feat: change routes

* fix: test

* Fix(state management): store state in global variable to allow the scheduler to access db (#8)

* Fix user batch invitation response model

* Fix: add missing param in send_emails_from_queue_task

* Get db directly using SessionLocal

* Store state in global Python variable

* Use arq 0.26.3

* Don't keep arq job results after completion

to be able to queue new jobs with the same id

* Cancel planned notification with the same job_id

before queuing a new one

* fixup state

* Access GLOBAL_STATE in tests init

* Remove unexpected state param while disconnecting

* Lint

* Parametrize test_factory fixture

* Lint

* Refactor test settings

* Lint

* Return email placeholder in variables (#15)

* Feed and feed from advert (#4)

* Feed

* Image endpoint and location and action fields

* Lint

* fix: rebase

* Add a logo for groups

* Feed: rename image_folder to image_directory

* Advert post to feed and remove tag

* Fix rebase

* Lint and migration

* Rebase migration

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* CoreAssociation (#13)

* CoreAssociation

* Migration

* Rebase migration

* Rename migration file 40 to 41 (#16)

* remove tags in update model (#17)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: circular import on windows (#20)

* remove status in admin query (#21)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Super admin (#22)

* feat: add super admin attribute

* feat: remove admin bypass

* fix: tests

* super user in factory (#23)

* super user in factory

* copilot this fyot

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Add for front (#24)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* PROXI-71: patch legal texts on request and update them (#12)

* feat: patch legals text on request

* feat: add end of support

* fix: typo

* Account deletion

* Apply suggestions from code review

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>

* fixes

* add email_placeholder to school

* fix config.yaml

* Fix indentation

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor Calendar to use associations and feed (#14)

* Refactor Calendar to use associations and feed

* Lint

* Migration

* Fix calendar factory condition

* Add a daylong event in calendar factory

* ical: use date for daylong events

instead of datetime

* Parametrize ical id

* Ticket url

* lint

* bump revision number

* remove description

* add post feed image

* fix : add image directory

* fix : use image id

* update factory

* admin id from GroupType enum

* post feed image in calendar

* Event image

* Lint

* Test

* fixup

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor advert to use associations (#18)

* Refactor Calendar to use associations and feed

* Migration

* Refactor advert to use associations

* fixup

* Migration

* Rebase migration

* rebase migration

* CalypSSO 2.4.0 (#25)

* typo (#26)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* typo (#29)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: replace placeholder in tos (#30)

* fix: replace placeholder in tos

* feat: prevent event with ticket and missing ticket field

* fix: typo

* feat: add tests

* PROXI 79: mypayment multi structure (#19)

* feat: add mypayment invoices

* fix: clean up

* Export PDF documentation

* Fix migration

* fix: typo

* fix: use structure as bank account holder

* fix: add missing config.template

* fix: extend s3 directory null check to empty string

* feat: add mypayment factory

* fix: rebase and correct factory

* fix: typo

* fix: missing function call

* fix: invoice pdf data

* fix: typo

* fix: use utils

* feat: add delay penalty

* fix: tests and rebase

* fix: move dependency

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Fix MyPayment Invoices (#33)

* fix: apply suggestions

* fix: typo

* fix: remove useless schema

* fix: typo

* Don't raise when feed picture does not exist and create data/campaigns folder at launch (#32)

* Don't raise when feed picture does not exist

but return an HTTPException

* Create data/campaigns folder at launch

---------

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Marc-Andrieu <146140470+Marc-Andrieu@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+foucblg@users.noreply.github.com>
Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>
Rotheem added a commit to ProximApp/Hyperion that referenced this pull request Aug 25, 2025
* v2.0.0 (#35)

* Set REFRESH_TOKEN_EXPIRE_MINUTES to 60 days (aeecleclair#753)

* raid-registering: Generate PDF from HTML template with weasyprint (aeecleclair#739)

Generate PDF using Jinja templates and WeasyPrint.

We use:
 - PyMuPDF for PDF manipulation, and conversion between image and PDF
 - WeasyPrint for PDF generation from HTML

We remove fpdf2 which html engine was too simple for complex templates

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* feat: support multiple HelloAsso configurations (aeecleclair#750)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Accept all schools accounts for WikijsAuthClient (aeecleclair#752)

* MyECLPay: use new CalypSSO UI for text assets (aeecleclair#763)

The link in the mail asserting you signed the ToS now brings to a less
austere page.

- [x] Bump CalypSSO to 2.2.0
- [x] Update mail link
  - [x] Use CalypSSO methods to build the URL

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Hyperion 4.6.0 (aeecleclair#762)

* Admin endpoint to send notification to group (aeecleclair#765)

* Hyperion configuration using yaml file (aeecleclair#756)

Hyperion will try to load its configuration, using, by precedence:
 - environment variables
 - .env.yaml file
 - .env file

* Allow to configure AuthClients using a dictionnary (aeecleclair#757)

instead of a list of list

This PR introduce a breaking change
Requires aeecleclair#756

* Acquire a lock before running initialization steps (aeecleclair#768)

If multiple workers are detected, and a Redis client, Hyperion will
raise an error.
Otherwise the server won't be able to:
 - run initialization steps
 - send messages over WebSocket reliably.

The logic is extracted from the great aeecleclair#375

---------

Co-authored-by: Thonyk <timr.web@free.fr>
Co-authored-by: Timothée Robert <114694873+Rotheem@users.noreply.github.com>

* Refactor app state using dependencies and state (aeecleclair#769)

Instead of initiating objects like redis client or db connection when
the dependency is called for the first time, we
create a dedicated `init_app_state` dependency to initialize all these
objects. These objects are stored in the application state instead of
global variables.

This ensures that an object may not be reused in another Hyperion app
instance, which would have its own event loop. This previously caused
issues for tests

Requires aeecleclair#768

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* Use an existing default file for raid rules (aeecleclair#771)

* Removed old init.py (aeecleclair#773)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Notification topics refactorization using a db table (aeecleclair#680)

Change completely the structure of topics in Hyperion. Instead of using
an Enum difficult to edit, we have a table in db with all existing
topics.

This allows to ensure that users can only subscribe to *real* topics.
Topics can be created either in the module definition (ex: `cinema`), or
using a utils from an endpoint (creation of a new topic each time we
create an advertiser in `announce`). Topics can now be restricted to a
specific group.

By default, all users are subscribed to each topic, they can unsubscribe
manually if they want.

A change in the frontend is required:
 - using `/notification/topics` the client will get all available topics
 - it could be nice to group topics by `module_root`

This PR will reset existing subscriptions. All users will be subscribed
to all topics, except for `advert`

Fix aeecleclair#479
Requires aeecleclair#768

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Optional HA api-base (aeecleclair#774)

* Only hash a global password for all test users (aeecleclair#776)

as hashing password is a time consuming operation. We expect a 2 min
gain over our test suite.

* Dotenv for Docker variables in addition to yaml config file (aeecleclair#778)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Feat : Add base to allow factory setup (aeecleclair#375)

Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>

* Change Dockerfile entrypoint to adapt new env_file parameter (aeecleclair#781)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Invert logic for unlock_key (aeecleclair#782)

Please explain the changes you made here.

- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the documentation, if necessary

* Allow to restrict registration to invited users (#6)

* Allow to restrict registration to invited users

* Add user to default_group on activation

* Invite users

* Queued emails

* Lint

* Cron for send mail task

* Lint

* Pass args directly instead of model in cruds

* Test batch invite user

* Docstring

* Don't send emails if the address is empty

* Only remove send mails from the queue

* Only send 100 email per hours

* Calypsso 2.3.0

* Fix

* Fixup

* Migration

* Lint

* Format

* Optional default_group_id

* Comment

* PROXI-54: modular association groupements (#9)

* feat: use modular association groupements

* typo

* fix: adapt factories to new system

* fix: rebase

* feat: change default logo

* fix: rebase

* fix: correct worker count when using --worker option (#10)

* School configuration (#7)

* Add user to default_group on activation

* Configurable email regex

* Configurable email regex

* Parametrize application name

* Configure the email regex directly in settings

* Rename centrale_lyon to this_school

* Import Pattern from re

* Use simple quotes for regex

* base_school

* Rename base_school in test

* Migration

* Self registration in config template

* Serve color and name of the project

* Remove unused css file and fix yaml template

* pydantic-extra-types==2.10.5

* Entity name

* Remove unused imports

* Rename is_user_a_school_member

* Rename get_school_account_types

* Rename is_user_an_ecl_member

* Documentation

* Lint

* Rename is_user_a_school_member

* fixup

* Remove unused code

* Validate users

* fix: rebase

---------

Co-authored-by: Thonyk <timr.web@free.fr>

* PROXI-61: rename payment files (#11)

* feat: rename payment part

* feat: rename tables

* fix: rebase

* feat: change routes

* fix: test

* Fix(state management): store state in global variable to allow the scheduler to access db (#8)

* Fix user batch invitation response model

* Fix: add missing param in send_emails_from_queue_task

* Get db directly using SessionLocal

* Store state in global Python variable

* Use arq 0.26.3

* Don't keep arq job results after completion

to be able to queue new jobs with the same id

* Cancel planned notification with the same job_id

before queuing a new one

* fixup state

* Access GLOBAL_STATE in tests init

* Remove unexpected state param while disconnecting

* Lint

* Parametrize test_factory fixture

* Lint

* Refactor test settings

* Lint

* Return email placeholder in variables (#15)

* Feed and feed from advert (#4)

* Feed

* Image endpoint and location and action fields

* Lint

* fix: rebase

* Add a logo for groups

* Feed: rename image_folder to image_directory

* Advert post to feed and remove tag

* Fix rebase

* Lint and migration

* Rebase migration

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Thonyk <timr.web@free.fr>

* CoreAssociation (#13)

* CoreAssociation

* Migration

* Rebase migration

* Rename migration file 40 to 41 (#16)

* remove tags in update model (#17)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: circular import on windows (#20)

* remove status in admin query (#21)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Super admin (#22)

* feat: add super admin attribute

* feat: remove admin bypass

* fix: tests

* super user in factory (#23)

* super user in factory

* copilot this fyot

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Add for front (#24)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* PROXI-71: patch legal texts on request and update them (#12)

* feat: patch legals text on request

* feat: add end of support

* fix: typo

* Account deletion

* Apply suggestions from code review

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>

* fixes

* add email_placeholder to school

* fix config.yaml

* Fix indentation

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor Calendar to use associations and feed (#14)

* Refactor Calendar to use associations and feed

* Lint

* Migration

* Fix calendar factory condition

* Add a daylong event in calendar factory

* ical: use date for daylong events

instead of datetime

* Parametrize ical id

* Ticket url

* lint

* bump revision number

* remove description

* add post feed image

* fix : add image directory

* fix : use image id

* update factory

* admin id from GroupType enum

* post feed image in calendar

* Event image

* Lint

* Test

* fixup

---------

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* Refactor advert to use associations (#18)

* Refactor Calendar to use associations and feed

* Migration

* Refactor advert to use associations

* fixup

* Migration

* Rebase migration

* rebase migration

* CalypSSO 2.4.0 (#25)

* typo (#26)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* typo (#29)

Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>

* fix: replace placeholder in tos (#30)

* fix: replace placeholder in tos

* feat: prevent event with ticket and missing ticket field

* fix: typo

* feat: add tests

* PROXI 79: mypayment multi structure (#19)

* feat: add mypayment invoices

* fix: clean up

* Export PDF documentation

* Fix migration

* fix: typo

* fix: use structure as bank account holder

* fix: add missing config.template

* fix: extend s3 directory null check to empty string

* feat: add mypayment factory

* fix: rebase and correct factory

* fix: typo

* fix: missing function call

* fix: invoice pdf data

* fix: typo

* fix: use utils

* feat: add delay penalty

* fix: tests and rebase

* fix: move dependency

---------

Co-authored-by: armanddidierjean <95971503+armanddidierjean@users.noreply.github.com>

* Fix MyPayment Invoices (#33)

* fix: apply suggestions

* fix: typo

* fix: remove useless schema

* fix: typo

* Don't raise when feed picture does not exist and create data/campaigns folder at launch (#32)

* Don't raise when feed picture does not exist

but return an HTTPException

* Create data/campaigns folder at launch

---------

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Marc-Andrieu <146140470+Marc-Andrieu@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+foucblg@users.noreply.github.com>
Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>

* fix: remove invalid config attribute

---------

Co-authored-by: Armand Didierjean <95971503+armanddidierjean@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+Foukki@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Marc-Andrieu <146140470+Marc-Andrieu@users.noreply.github.com>
Co-authored-by: Foucauld Bellanger <63885990+foucblg@users.noreply.github.com>
Co-authored-by: Warix <39554785+warix8@users.noreply.github.com>
Co-authored-by: cotanoine <tan.maillard@gmail.com>
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.

3 participants