Skip to content
Snippets Groups Projects
Commit e1444e09 authored by Pauline Gründel's avatar Pauline Gründel
Browse files

methode id nicht negativ hinzugefügt

parent 64dc9996
No related branches found
No related tags found
1 merge request!20Draft: Resolve "Backend: Project mit negativen Id's möglich"
......@@ -52,6 +52,11 @@ class Project(BaseModel):
if not re.match(r"^(0[1-9]|1[0-2])-\d{4}$", value):
raise ValueError("Das Datum muss im Format MM-YYYY sein.")
return value
def validate_id(cls, value):
if id < 0:
raise ValueError("Die id muss positiv sein.")
return value
def load_projects():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment