Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c5a493f
WIP Basic cruds
warix8 Nov 30, 2025
07d921c
Small fixes
warix8 Nov 30, 2025
10a0160
Create factory_ticketing.py
warix8 Nov 30, 2025
a2506ad
Fix typing
warix8 Nov 30, 2025
91b967c
Added migrations
warix8 Nov 30, 2025
4b726cc
Various fixes
warix8 Nov 30, 2025
6d84e17
WIP
warix8 Feb 9, 2026
d00d7fc
WIP Test init
warix8 Feb 9, 2026
5b47988
WIP tests init
warix8 Feb 17, 2026
93dc121
Finish rebase
warix8 Feb 17, 2026
3e48ad0
Handle new permissions
warix8 Feb 17, 2026
40aa4b2
Fix parametrized test
warix8 Feb 17, 2026
4fdc1c8
Cannot parametrize global variables
warix8 Feb 17, 2026
5f34592
Migrations rebase
warix8 Feb 17, 2026
9c9f838
WIP
warix8 Feb 17, 2026
ed2f74e
repaired migrations
warix8 Feb 17, 2026
d98e32b
First fixes
warix8 Feb 18, 2026
b9b1272
Renaming due to SQLAlchemy class conflict
warix8 Feb 18, 2026
cdb29d4
Redone migrations
warix8 Feb 18, 2026
7daecd7
Fix factory test
warix8 Feb 18, 2026
6e8a80e
Forgot to return a 404
warix8 Feb 18, 2026
2f428f6
Tests for events
warix8 Feb 28, 2026
50dd1ec
Lint
warix8 Feb 28, 2026
d6e754c
Fixed tests (locally)
warix8 Feb 28, 2026
06c7504
Rebase migration
warix8 Feb 28, 2026
aa8e4c0
add organisers
NakoGH Mar 3, 2026
9072ca1
add: date to sessions
NakoGH Mar 10, 2026
8aedbe7
wip
NakoGH Mar 13, 2026
d4abcf9
rebase migrations & fix tests
warix8 Mar 19, 2026
cb97e6d
Finished tests for sessions
warix8 Mar 19, 2026
fb9c4fa
ruff format
warix8 Mar 19, 2026
8550348
relint
warix8 Mar 19, 2026
ee067ba
WIP Tests categories
warix8 Apr 2, 2026
c33bfaa
Fixed Categories
warix8 Apr 27, 2026
53d7daf
Format
warix8 Apr 27, 2026
05ce2b9
Remove print()
warix8 Apr 27, 2026
046ac6c
Redis helpers
warix8 Apr 27, 2026
2109042
Fix mypy issues
warix8 Apr 27, 2026
3ff0834
Fix every mypy, ruff errors
warix8 Apr 27, 2026
6520461
Wtf ruff format != check
warix8 Apr 27, 2026
dc926a1
Ruff is broken Grr
warix8 Apr 27, 2026
8df19df
WIP tickets
warix8 Jun 1, 2026
b450919
Adding the remaining quota (with cache)
warix8 Jun 6, 2026
1c8cd3f
Lint and format
warix8 Jun 6, 2026
1e605be
removed used quota property
warix8 Jun 6, 2026
48b42f3
Trailing comma missing
warix8 Jun 6, 2026
ede31a8
Format again
warix8 Jun 6, 2026
5a3ed68
Rebase migration
warix8 Jun 6, 2026
c1223ec
Missing used_quota init
warix8 Jun 6, 2026
71c8129
add user relationship for tickets
NakoGH Jun 9, 2026
9c8a70a
edit sessions date
NakoGH Aug 12, 2026
d9319db
Fix missing user relation
warix8 Sep 2, 2026
b08565b
permissions and memberships
warix8 Sep 5, 2026
1a020f5
Forgot to set in cache for checking perms
warix8 Sep 5, 2026
0468d0d
rebase migration
warix8 Sep 5, 2026
8b70ea8
Corrected tests
warix8 Sep 6, 2026
c2f8892
Fix tests, linting
warix8 Sep 6, 2026
0d49eda
Fix factory
warix8 Sep 6, 2026
9b5f7ef
Added ticket secret
warix8 Sep 6, 2026
c69c0a2
Fix missing secret in tests
warix8 Sep 6, 2026
b409db1
Added can_manage_ticketing perm to sellers
warix8 Sep 6, 2026
9503c7b
Fix last tests bug
warix8 Sep 6, 2026
8671055
Use server default
warix8 Sep 7, 2026
e771dca
Try to fix preprod
warix8 Sep 8, 2026
214f9db
Forgot await
warix8 Sep 8, 2026
3da012d
Try to fix factories
warix8 Sep 8, 2026
9edd6f7
ooops
warix8 Sep 8, 2026
94e3f69
Disabled raid factories
warix8 Sep 8, 2026
5dafe64
Try to fix bugs + add missing endpoint
warix8 Sep 10, 2026
b51a47f
Forgot cached quota invalidation
warix8 Sep 10, 2026
8d23e55
Never trust auto complete
warix8 Sep 10, 2026
a60229b
remove await on some cache func
warix8 Sep 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/core/mypayment/cruds_mypayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ async def create_seller(
can_see_history: bool,
can_cancel: bool,
can_manage_sellers: bool,
can_manage_ticketing: bool,
db: AsyncSession,
) -> None:
wallet = models_mypayment.Seller(
Expand All @@ -279,6 +280,7 @@ async def create_seller(
can_see_history=can_see_history,
can_cancel=can_cancel,
can_manage_sellers=can_manage_sellers,
can_manage_ticketing=can_manage_ticketing,
)
db.add(wallet)

Expand Down Expand Up @@ -308,6 +310,7 @@ async def get_seller(
can_see_history=result.can_see_history,
can_cancel=result.can_cancel,
can_manage_sellers=result.can_manage_sellers,
can_manage_ticketing=result.can_manage_ticketing,
user=schemas_users.CoreUserSimple(
id=result.user.id,
firstname=result.user.firstname,
Expand Down Expand Up @@ -339,6 +342,7 @@ async def get_sellers_by_store_id(
can_see_history=seller.can_see_history,
can_cancel=seller.can_cancel,
can_manage_sellers=seller.can_manage_sellers,
can_manage_ticketing=seller.can_manage_ticketing,
user=schemas_users.CoreUserSimple(
id=seller.user.id,
firstname=seller.user.firstname,
Expand Down
10 changes: 10 additions & 0 deletions app/core/mypayment/endpoints_mypayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ async def create_structure_administrator(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
db=db,
)
else:
Expand All @@ -408,6 +409,7 @@ async def create_structure_administrator(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
),
db=db,
)
Expand Down Expand Up @@ -475,6 +477,7 @@ async def delete_structure_administrator(
seller_update=schemas_mypayment.SellerUpdate(
can_cancel=False,
can_manage_sellers=False,
can_manage_ticketing=False,
),
db=db,
)
Expand Down Expand Up @@ -617,6 +620,7 @@ async def confirm_structure_manager_transfer(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
db=db,
)
else:
Expand All @@ -628,6 +632,7 @@ async def confirm_structure_manager_transfer(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
),
db=db,
)
Expand Down Expand Up @@ -715,6 +720,7 @@ async def create_store(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
db=db,
)
for admin in structure.administrators:
Expand All @@ -725,6 +731,7 @@ async def create_store(
can_see_history=True,
can_cancel=True,
can_manage_sellers=True,
can_manage_ticketing=True,
db=db,
)

Expand Down Expand Up @@ -1014,6 +1021,7 @@ async def get_user_stores(
can_see_history=seller.can_see_history,
can_cancel=seller.can_cancel,
can_manage_sellers=seller.can_manage_sellers,
can_manage_ticketing=seller.can_manage_ticketing,
),
)

Expand Down Expand Up @@ -1164,6 +1172,7 @@ async def create_store_seller(
- can_see_history
- can_cancel
- can_manage_sellers
- can_manage_ticketing

**The user must have the `can_manage_sellers` permission for this store**
"""
Expand Down Expand Up @@ -1206,6 +1215,7 @@ async def create_store_seller(
can_see_history=seller.can_see_history,
can_cancel=seller.can_cancel,
can_manage_sellers=seller.can_manage_sellers,
can_manage_ticketing=seller.can_manage_ticketing,
db=db,
)

Expand Down
1 change: 1 addition & 0 deletions app/core/mypayment/models_mypayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ class Seller(Base):
can_see_history: Mapped[bool]
can_cancel: Mapped[bool]
can_manage_sellers: Mapped[bool]
can_manage_ticketing: Mapped[bool]

user: Mapped[models_users.CoreUser] = relationship(init=False, lazy="joined")

Expand Down
4 changes: 4 additions & 0 deletions app/core/mypayment/schemas_mypayment.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class UserStore(Store):
can_see_history: bool
can_cancel: bool
can_manage_sellers: bool
can_manage_ticketing: bool


class StoreUpdate(BaseModel):
Expand All @@ -102,13 +103,15 @@ class SellerCreation(BaseModel):
can_see_history: bool
can_cancel: bool
can_manage_sellers: bool
can_manage_ticketing: bool


class SellerUpdate(BaseModel):
can_bank: bool | None = None
can_see_history: bool | None = None
can_cancel: bool | None = None
can_manage_sellers: bool | None = None
can_manage_ticketing: bool | None = None


class Seller(BaseModel):
Expand All @@ -118,6 +121,7 @@ class Seller(BaseModel):
can_see_history: bool
can_cancel: bool
can_manage_sellers: bool
can_manage_ticketing: bool

user: schemas_users.CoreUserSimple

Expand Down
1 change: 0 additions & 1 deletion app/modules/cdr/exception_cdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class SignatureNotFoundError(Exception):
"""Raised when a signature is not found for a document."""

def __init__(self, document_id: UUID):

super().__init__(
f"Signature with numeric_signature_id {document_id} not found.",
)
2 changes: 0 additions & 2 deletions app/modules/cdr/utils_cdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ async def start_signature_flow(
db: AsyncSession,
settings: Settings,
):

for cdr_document in product.document_constraints:
existing_signature = await cruds_cdr.get_signature_by_user_id_and_document_id(
db=db,
Expand Down Expand Up @@ -796,7 +795,6 @@ def construct_dataframe_from_users_purchases(
users_curriculum: dict[str, str],
export_io: BytesIO,
):

product_structure, col_idx = build_product_structure(
products,
variants,
Expand Down
38 changes: 26 additions & 12 deletions app/modules/raid/factory_raid.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,39 @@ class RaidFactory(Factory):

@classmethod
async def should_run(cls, db: AsyncSession) -> bool:
return await cruds_raid.get_all_editions(db) == []
# return await cruds_raid.get_all_editions(db) == []
return False # BUG: Please fix that

@classmethod
async def _ensure_raid_admin_group(cls, db: AsyncSession) -> None:
"""Create the raid_admin group + permission and grant it to the
admin demo user if config.yaml defined one."""
raid_admin_group = CoreGroup(
id=RAID_ADMIN_GROUP_ID,
name="raid_admin",
description="Raid organizers with manage_raid permission",
# Check if group already exists
raid_admin_group_id = RAID_ADMIN_GROUP_ID
db_group = await cruds_groups.get_group_by_id(
db=db,
group_id=raid_admin_group_id,
)
await cruds_groups.create_group(db=db, group=raid_admin_group)
await cruds_permissions.create_group_permission(
permission=schemas_permissions.CoreGroupPermission(
permission_name="manage_raid",
group_id=RAID_ADMIN_GROUP_ID,
),
db_group_name = await cruds_groups.get_group_by_name(
db=db,
group_name="raid_admin",
)
if db_group is None and db_group_name is None:
raid_admin_group = CoreGroup(
id=raid_admin_group_id,
name="raid_admin",
description="Raid organizers with manage_raid permission",
)
await cruds_groups.create_group(db=db, group=raid_admin_group)
await cruds_permissions.create_group_permission(
permission=schemas_permissions.CoreGroupPermission(
permission_name="manage_raid",
group_id=raid_admin_group_id,
),
db=db,
)
if db_group is None and db_group_name is not None:
raid_admin_group_id = db_group_name.id

admin_user = await cruds_users.get_user_by_email(
db=db,
Expand All @@ -67,7 +81,7 @@ async def _ensure_raid_admin_group(cls, db: AsyncSession) -> None:
await cruds_groups.create_membership(
db=db,
membership=CoreMembership(
group_id=RAID_ADMIN_GROUP_ID,
group_id=raid_admin_group_id,
user_id=admin_user.id,
description=None,
),
Expand Down
3 changes: 2 additions & 1 deletion app/modules/raid/utils/validation_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

from fastapi import HTTPException

from app.modules.raid import cruds_raid
from app.modules.raid.raid_type import (
DocumentValidation,
RaidRegistrationStatus,
Expand Down Expand Up @@ -132,6 +131,8 @@ async def _check_team_complete(
participant: schemas_raid.RaidParticipant,
db: AsyncSession,
) -> None:
from app.modules.raid import cruds_raid # noqa: PLC0415

team = await cruds_raid.get_team_by_participant_id(
participant.user_id,
participant.edition_id,
Expand Down
Empty file.
Loading
Loading