lint: reformat python code with black

This commit is contained in:
Iain Learmonth 2024-12-06 18:15:47 +00:00
parent 331beb01b4
commit a406a7974b
88 changed files with 2579 additions and 1608 deletions

View file

@ -7,18 +7,15 @@ from app.models.alarms import Alarm
def alarms_for(target: BRN) -> List[Alarm]:
return list(Alarm.query.filter(
Alarm.target == str(target)
).all())
return list(Alarm.query.filter(Alarm.target == str(target)).all())
def _get_alarm(target: BRN,
aspect: str,
create_if_missing: bool = True) -> Optional[Alarm]:
def _get_alarm(
target: BRN, aspect: str, create_if_missing: bool = True
) -> Optional[Alarm]:
target_str = str(target)
alarm: Optional[Alarm] = Alarm.query.filter(
Alarm.aspect == aspect,
Alarm.target == target_str
Alarm.aspect == aspect, Alarm.target == target_str
).first()
if create_if_missing and alarm is None:
alarm = Alarm()