Add active check

This commit is contained in:
2026-08-05 00:27:08 +02:00
parent 0497d1bbcf
commit bbb41e41ab
2 changed files with 2 additions and 2 deletions
+2
View File
@@ -103,6 +103,8 @@ def checkAccess(key: str, db: Session):
card = db.exec(select(Card).where(Card.key == key)).one() card = db.exec(select(Card).where(Card.key == key)).one()
for auth in card.group.accessauths: for auth in card.group.accessauths:
logger.info(f"checking auth: {auth.name}") logger.info(f"checking auth: {auth.name}")
if not auth.is_active:
return False
if auth.type == "timetable": if auth.type == "timetable":
for timetable in auth.timetables: for timetable in auth.timetables:
logger.info(f" checking timetable {timetable.id}") logger.info(f" checking timetable {timetable.id}")
-2
View File
@@ -18,7 +18,6 @@ from desfire.enums import (
DESFireKeyType, DESFireKeyType,
) )
from desfire.schemas import FilePermissions, FileSettings, KeySettings from desfire.schemas import FilePermissions, FileSettings, KeySettings
from dotenv import load_dotenv
from fastapi import HTTPException, status from fastapi import HTTPException, status
from smartcard.CardRequest import CardRequest from smartcard.CardRequest import CardRequest
from smartcard.CardType import AnyCardType from smartcard.CardType import AnyCardType
@@ -30,7 +29,6 @@ from app.services.settings import settings
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# ENV vars # ENV vars
load_dotenv()
MIFARE_APP_MASTER_KEY = settings.mifare_app_master_key MIFARE_APP_MASTER_KEY = settings.mifare_app_master_key
MIFARE_ACL_READ_BASE_KEY = settings.mifare_acl_read_base_key MIFARE_ACL_READ_BASE_KEY = settings.mifare_acl_read_base_key
MIFARE_ACL_WRITE_BASE_KEY = settings.mifare_acl_write_base_key MIFARE_ACL_WRITE_BASE_KEY = settings.mifare_acl_write_base_key