Merge remote-tracking branch 'origin/master' into feature/tasks

This commit is contained in:
Timur
2025-03-01 12:27:32 +03:00
4 changed files with 22 additions and 8 deletions
@@ -11,7 +11,7 @@ class CompetitionOut(ModelSchema):
class Meta:
model = Competition
fields = "__all__"
exclude = ("participants",)
class StateOut(ModelSchema):
+1 -1
View File
@@ -22,4 +22,4 @@ class LoginSchema(ModelSchema):
class UserSchema(ModelSchema):
class Meta:
model = User
fields = ["email", "username"]
fields = ["id", "email", "username"]
+10
View File
@@ -54,6 +54,16 @@ def sign_in(request, data: LoginSchema):
return status.OK, TokenSchema(token=token)
@router.get(
"/me",
response={
status.OK: UserSchema,
status.UNAUTHORIZED: ForbiddenError,
},
)
def get_me(request):
return 200, request.auth
@router.get(
path="/user/{user_id}",
response={