Skip to content

Commit

Permalink
Merge pull request #269 from LleidaHack/group-yearly-fix
Browse files Browse the repository at this point in the history
Group yearly fix
  • Loading branch information
elver5041 authored Oct 25, 2024
2 parents 9a68fd7 + e57e2ee commit 1675f07
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/impl/Article/router_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def get_all():


@router.get("/{id}", response_model=Union[ArticleGetAll, ArticleGet])
def get():
return article_service.get(id)
def get_by_id(id: int):
return article_service.get_by_id(id)


@router.put("/{id}")
Expand Down
5 changes: 3 additions & 2 deletions src/impl/Event/router_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from src.impl.Event.schema import EventGetAll
from src.impl.Event.schema import EventUpdate
from src.impl.Event.service import EventService
from src.impl.Hacker.schema import HackerGet
from src.impl.Hacker.schema import HackerGet, HackerGetAll
from src.impl.HackerGroup.schema import HackerGroupGet
from src.impl.Meal.schema import MealGet
from src.utils.JWTBearer import JWTBearer
Expand Down Expand Up @@ -177,7 +177,8 @@ def remove_sponsor(id: int,
return {'success': True, 'event_id': event.id}


@router.get("/{eventId}/get_approved_hackers", response_model=List[HackerGet])
@router.get("/{eventId}/get_approved_hackers",
response_model=List[HackerGetAll])
def get_accepted_hackers(eventId: int,
token: BaseToken = Depends(JWTBearer())):
return event_service.get_accepted_hackers(eventId, token)
Expand Down
2 changes: 1 addition & 1 deletion src/impl/Event/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def get_accepted_hackers(self, event_id: int, data: BaseToken):
if not data.check([UserType.LLEIDAHACKER]):
raise AuthenticationException("Not authorized")
event = self.get_by_id(event_id)
return HackerGetAll.model_validate(event.accepted_hackers)
return event.accepted_hackers

def get_accepted_hackers_mails(self, event_id: int, data: BaseToken):
if not data.check([UserType.LLEIDAHACKER]):
Expand Down

0 comments on commit 1675f07

Please sign in to comment.