doorcontrol: Use enum members instead of raw ids for "red" event types

This commit is contained in:
Adam Goldsmith 2023-09-19 00:11:44 -04:00
parent 05037b74fc
commit cb8bf3da4f

View File

@ -10,19 +10,19 @@ class HIDEventQuerySet(models.QuerySet):
is_red=ExpressionWrapper(
Q(
event_type__in=[
1022,
1023,
2024,
2029,
2036,
2042,
2043,
2046,
4041,
4042,
4043,
4044,
4045,
HIDEvent.EventType.DENIED_ACCESS_CARD_NOT_FOUND,
HIDEvent.EventType.DENIED_ACCESS_ACCESS_PIN_NOT_FOUND,
HIDEvent.EventType.DENIED_ACCESS_SCHEDULE,
HIDEvent.EventType.DENIED_ACCESS_WRONG_PIN,
HIDEvent.EventType.DENIED_ACCESS_CARD_EXPIRED,
HIDEvent.EventType.DENIED_ACCESS_PIN_LOCKOUT,
HIDEvent.EventType.DENIED_ACCESS_UNASSIGNED_CARD,
HIDEvent.EventType.DENIED_ACCESS_PIN_EXPIRED,
HIDEvent.EventType.DOOR_FORCED_ALARM,
HIDEvent.EventType.DOOR_HELD_ALARM,
HIDEvent.EventType.TAMPER_SWITCH_ALARM,
HIDEvent.EventType.AC_FAILURE,
HIDEvent.EventType.BATTERY_FAILURE,
]
),
output_field=models.BooleanField(),