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

Group yearly fix #269

Merged
merged 4 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
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
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
Loading