Skip to content

Conversation

@solarmarius
Copy link

  • Add prioritizedRegistrationDate and prioritizedYears fields to EventInput and EventUpdate models
  • Implement early registration access for specific årskull years
  • Update valid_registration() function to check prioritized access before regular registration
  • Add validation to ensure prioritized registration date occurs before regular registration date

- Add prioritizedRegistrationDate and prioritizedYears fields to EventInput and EventUpdate models
- Implement early registration access for specific årskull years
- Update valid_registration() function to check prioritized access before regular registration
- Add validation to ensure prioritized registration date occurs before regular registration date
Copy link
Contributor

@TorgrimRL TorgrimRL left a comment

Choose a reason for hiding this comment

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

Bra jobba Marius!
Ta en titt på kommentarene mine og gjerne oppdater testene til spesielt create event og update event slik at vi kan verifisere at alt du har laget funker som det skal. Legger deg til organisasjonen, da skal du kunne sjekke build pipelinen selv også.

if values[key]:
updateInfo[key] = values[key]

# Check if classof is being updated and already has a value
Copy link
Contributor

Choose a reason for hiding this comment

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

Kunne du forklart hvorfor du tenker å stoppe brukeren her?

Copy link
Author

Choose a reason for hiding this comment

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

Relatert til prioritering ved årskull - brukere som allerede har satt et årskull skal ikke kunne endre det for å hindre misbruk.

400, "Prioritized registration date must be before regular registration date")
except ValueError:
raise HTTPException(
400, "Invalid date format for prioritized registration date")
Copy link
Contributor

Choose a reason for hiding this comment

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

Vil ikke vi også komme hit om det var parsingen til regular date som feilet og?

validate_registartion_opening_time(
event.date, event.registrationOpeningDate)

if event.prioritizedRegistrationDate != None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Bra at du sjekker at prioritizedRegistrationDate finnes, validerer den mot selve event-datoen, og – hvis ordinær åpning finnes – at prioritert < ordinær. 👍

event.date, event.prioritizedRegistrationDate)

# Prioritized registration date must be before regular registration date
if event.registrationOpeningDate != None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Fin ungåelse av unødvendig parsing.



def valid_registration(opening_date):
def valid_registration(opening_date, member=None, event=None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Prioritert sjekk kommer først og “kortslutter” til True når vinduet er åpent – god rekkefølge og lett å lese. Bra

- Simplify date comparison in event_utils by using direct datetime comparison instead of redundant parsing
- Remove unnecessary nested conditionals when validating prioritized registration dates
- Clarify classof immutability comment to explain business logic preventing privilege manipulation
@solarmarius
Copy link
Author

Ser at parsing-logikken for validate_event_dates var overflødig, så har gjort den enklere. Samt spesifisert kommentar for classof under update_member.

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.

2 participants