Skip to content

Commit

Permalink
some formating
Browse files Browse the repository at this point in the history
  • Loading branch information
istar410 committed Nov 16, 2023
1 parent 3537e79 commit ff1a0c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions insalan/tournament/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_teams_id(self) -> List[int]:
def get_rules(self) -> str:
"""Return the raw tournament rules"""
return self.rules

def get_maxTeam(self) -> int:
"""Return the max number of teams"""
return self.maxTeam
Expand Down Expand Up @@ -423,7 +423,7 @@ def get_managers_id(self) -> List[int]:
Retrieve the user identifiers of all managers
"""
return self.get_managers().values_list("id", flat=True)

def get_password(self) -> str:
"""Return team password"""
return self.password
Expand Down
6 changes: 3 additions & 3 deletions insalan/tournament/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def validate(self, data):
raise serializers.ValidationError(
_("Utilisateur⋅rice déjà inscrit⋅e dans un tournoi de cet évènement")
)

if len(data.get("players_pseudos", [])) != len(data.get("get_players_id", [])):
raise serializers.ValidationError(_("Il manque des pseudos de joueur⋅euses"))

return data


def create(self, validated_data):
"""Create a Team from input data"""
Expand Down Expand Up @@ -192,7 +192,7 @@ class Meta:

model = Manager
fields = "__all__"

def validate(self, data):
event = Event.objects.get(tournament__team=data["team"])
if not unique_event_registration(data["user"],event):
Expand Down
4 changes: 2 additions & 2 deletions insalan/tournament/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def post(self, request, *args, **kwargs):
]
}
)

if not check_password(data["password"], Team.objects.get(pk=data["team"]).get_password()):
return Response(
{ "password": _("Mot de passe invalide.")},
Expand Down Expand Up @@ -337,7 +337,7 @@ def post(self, request, *args, **kwargs):
raise PermissionDenied()

if (
"team" not in data
"team" not in data
or "payment" in data
or "password" not in data
) :
Expand Down

0 comments on commit ff1a0c3

Please sign in to comment.