Skip to content

Commit

Permalink
last fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
xerbalind committed Apr 18, 2024
1 parent df06d81 commit 080228f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions backend/src/project/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ class ProjectBase(BaseModel):
capacity: int = Field(gt=0)
requirements: List[Requirement] = []

# Check if deadline is not in the past
@field_validator("deadline")
def validate_deadline(cls, value: datetime) -> datetime:
if value < datetime.now(value.tzinfo):
raise ValueError("The deadline cannot be in the past")
return value

@field_validator("description")
def validate_description(cls, value: str) -> str:
return escape(value, quote=False)
Expand All @@ -36,6 +29,13 @@ def validate_description(cls, value: str) -> str:
class ProjectCreate(ProjectBase):
pass

# Check if deadline is not in the past
@field_validator("deadline")
def validate_deadline(cls, value: datetime) -> datetime:
if value < datetime.now(value.tzinfo):
raise ValueError("The deadline cannot be in the past")
return value


class Project(ProjectBase):
model_config = ConfigDict(from_attributes=True)
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/SubjectRegisterView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { data: subject, error, isLoading, isError } = useSubjectUuidQuery(ref(pro
const register = () => {
refetch();
router.push({ name: "subject", params: { subjectId: subject.id } });
router.push({ name: "subject", params: { subjectId: subject.value?.id } });
};
const cancel = () => router.push({ name: "home" });
Expand Down

0 comments on commit 080228f

Please sign in to comment.