Remove points limit
This commit is contained in:
@@ -366,7 +366,7 @@ async def save_challenges(
|
||||
description=ch_data.description,
|
||||
type=ch_type,
|
||||
difficulty=difficulty,
|
||||
points=max(1, min(500, ch_data.points)),
|
||||
points=max(1, ch_data.points),
|
||||
estimated_time=ch_data.estimated_time,
|
||||
proof_type=proof_type,
|
||||
proof_hint=ch_data.proof_hint,
|
||||
|
||||
@@ -19,7 +19,7 @@ class ChallengeBase(BaseModel):
|
||||
description: str = Field(..., min_length=1)
|
||||
type: ChallengeType
|
||||
difficulty: Difficulty
|
||||
points: int = Field(..., ge=1, le=1000)
|
||||
points: int = Field(..., ge=1)
|
||||
estimated_time: int | None = Field(None, ge=1) # minutes
|
||||
proof_type: ProofType
|
||||
proof_hint: str | None = None
|
||||
@@ -34,7 +34,7 @@ class ChallengeUpdate(BaseModel):
|
||||
description: str | None = None
|
||||
type: ChallengeType | None = None
|
||||
difficulty: Difficulty | None = None
|
||||
points: int | None = Field(None, ge=1, le=1000)
|
||||
points: int | None = Field(None, ge=1)
|
||||
estimated_time: int | None = None
|
||||
proof_type: ProofType | None = None
|
||||
proof_hint: str | None = None
|
||||
|
||||
@@ -20,7 +20,7 @@ class GameCreate(GameBase):
|
||||
game_type: GameType = GameType.CHALLENGES
|
||||
|
||||
# Поля для типа "Прохождение"
|
||||
playthrough_points: int | None = Field(None, ge=1, le=1000)
|
||||
playthrough_points: int | None = Field(None, ge=1)
|
||||
playthrough_description: str | None = None
|
||||
playthrough_proof_type: ProofType | None = None
|
||||
playthrough_proof_hint: str | None = None
|
||||
@@ -46,7 +46,7 @@ class GameUpdate(BaseModel):
|
||||
game_type: GameType | None = None
|
||||
|
||||
# Поля для типа "Прохождение"
|
||||
playthrough_points: int | None = Field(None, ge=1, le=1000)
|
||||
playthrough_points: int | None = Field(None, ge=1)
|
||||
playthrough_description: str | None = None
|
||||
playthrough_proof_type: ProofType | None = None
|
||||
playthrough_proof_hint: str | None = None
|
||||
|
||||
@@ -124,12 +124,6 @@ points: easy=20-40, medium=45-75, hard=90-150
|
||||
points = ch.get("points", 30)
|
||||
if not isinstance(points, int) or points < 1:
|
||||
points = 30
|
||||
if difficulty == "easy":
|
||||
points = max(20, min(40, points))
|
||||
elif difficulty == "medium":
|
||||
points = max(45, min(75, points))
|
||||
elif difficulty == "hard":
|
||||
points = max(90, min(150, points))
|
||||
|
||||
return ChallengeGenerated(
|
||||
title=ch.get("title", "Unnamed Challenge")[:100],
|
||||
|
||||
Reference in New Issue
Block a user