Skip to content

Commit

Permalink
Add validator decorator
Browse files Browse the repository at this point in the history
Added the '@validator' decorator to TimeType, runs into QuantityType error on the period attribute
  • Loading branch information
Tanner728 authored Jan 1, 2024
1 parent 3c2f717 commit a0f12d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stellarphot/settings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path

from pydantic import BaseModel, Field, conint
from pydantic import BaseModel, Field, conint, validator

from .autowidgets import CustomBoundedIntTex

Expand Down Expand Up @@ -171,7 +171,7 @@ class Config:
QuantityType: lambda v: f"{v.value} {v.unit}",
Time: lambda v: f"{v.value}",
}

@validator
@classmethod
def validate_period(cls, values):
"""
Expand Down

0 comments on commit a0f12d1

Please sign in to comment.