[lint] fix warnings not autofixed by ruff
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
import os
|
||||
import secrets
|
||||
import string
|
||||
@@ -15,7 +13,9 @@ from pwdlib import PasswordHash
|
||||
from sqlmodel import Session, select
|
||||
|
||||
from app.model.models import Token, TokenData, UserDB
|
||||
from app.services.database import *
|
||||
from app.services.database import add_and_refresh, get_session
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SECRET_KEY = os.getenv("SECRET_KEY", default="ff" * 16)
|
||||
ALGORITHM = "HS256"
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import logging
|
||||
from os import getenv, path
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from os import getenv, path
|
||||
|
||||
from sqlmodel import Session, SQLModel, create_engine
|
||||
|
||||
SQLALCHEMY_DATABASE_URL = getenv("SQLALCHEMY_DATABASE_URL", "sqlite:///./gatekeeper.db")
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from datetime import date, datetime, timedelta
|
||||
|
||||
from sqlalchemy import exc
|
||||
from sqlmodel import select
|
||||
|
||||
from app.model.models import *
|
||||
from app.model.models import Card, OneShotAccess
|
||||
from app.services.database import Session, add_and_refresh
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
doorIsOpen = True
|
||||
# I think this could also be gpio controlled
|
||||
# See: https://github.com/technyon/nuki_hub#gpio-lock-control-optional
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
import os
|
||||
import secrets
|
||||
import threading
|
||||
@@ -30,6 +27,8 @@ from smartcard.Exceptions import CardRequestTimeoutException
|
||||
|
||||
from app.services.door import checkAccess, openDoor
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
# ENV vars
|
||||
load_dotenv()
|
||||
MIFARE_APP_MASTER_KEY = os.getenv("MIFARE_APP_MASTER_KEY")
|
||||
@@ -45,7 +44,7 @@ MIFARE_ENCRYPTED_FILE_ID = 0x1
|
||||
|
||||
|
||||
def checkForKey():
|
||||
if MIFARE_APP_MASTER_KEY == None:
|
||||
if MIFARE_APP_MASTER_KEY is None:
|
||||
logger.critical("NO MASTER KEY LOADED")
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
@@ -334,7 +333,7 @@ class BackgroundScanner:
|
||||
|
||||
def _check_db(self, key):
|
||||
check = checkAccess(key, self.db)
|
||||
if check == True:
|
||||
if check:
|
||||
openDoor()
|
||||
logger.info("Access granted!")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user