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

Invoke functions and retreive constants form the object of TeamsRepository #788

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions services/py-api/src/service/participants_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ async def _check_capacity_register_admin_participant_case(self) -> bool:

# Calculate the anticipated number of teams
number_ant_teams = verified_registered_teams + ceil(
verified_random_participants / TeamsRepository.MAX_NUMBER_OF_TEAM_MEMBERS
verified_random_participants / self._team_repo.MAX_NUMBER_OF_TEAM_MEMBERS
)

# Check against the hackathon capacity
return number_ant_teams < TeamsRepository.MAX_NUMBER_OF_TEAMS_IN_HACKATHON
return number_ant_teams < self._team_repo.MAX_NUMBER_OF_TEAMS_IN_HACKATHON

async def register_admin_participant(self, input_data: ParticipantRequestBody) -> Result[
Tuple[Participant, Team],
Expand All @@ -63,7 +63,7 @@ async def register_admin_participant(self, input_data: ParticipantRequestBody) -
# Capacity Check 2
has_capacity = await self._check_capacity_register_admin_participant_case()
if not has_capacity:
return Err(HackathonCapacityExceededError(self._team_repo.MAX_NUMBER_OF_TEAMS_IN_HACKATHON))
return Err(HackathonCapacityExceededError())

# Proceed with registration if there is capacity
result = await self._tx_manager.with_transaction(self._create_participant_and_team_in_transaction, input_data)
Expand Down