From 6f45fc95aa534d80c32e98492726fafd5cc401d5 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Tue, 7 Jun 2022 19:17:32 +0300 Subject: [PATCH] sql_app: remove record_user_connection() due to bug. fix later Signed-off-by: HeshamTB --- sql_app/main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sql_app/main.py b/sql_app/main.py index 6d56bfb..4deca7a 100644 --- a/sql_app/main.py +++ b/sql_app/main.py @@ -77,13 +77,13 @@ def create_user(user: schemas.UserCreate, db: Session = Depends(get_db)): data={"sub": db_user.username}, expires_delta=timedelta(minutes=15) ) crud.set_user_last_token(db, db_user.username, access_token) - crud.record_user_connection(db, db_user, datetime.now()) + #crud.record_user_connection(db, db_user, datetime.now()) return db_user @app.get("/users/me/", response_model=schemas.User, tags=['Users']) def get_user_details(db: Session = Depends(get_db), current_user: schemas.User = Depends(get_current_active_user)): - crud.record_user_connection(db, current_user, datetime.now()) + #crud.record_user_connection(db, current_user, datetime.now()) return current_user @app.post("/users/open", tags=['Users']) @@ -104,7 +104,7 @@ def issue_open_door_command(command: schemas.OpenDoorRequestTime, command="OPEN", timestamp=datetime.now()) crud.record_door_access_log(db, log_entry) - crud.record_user_connection(db, current_user, datetime.now()) + #crud.record_user_connection(db, current_user, datetime.now()) return device raise err @@ -126,7 +126,7 @@ def issue_close_door_command(command: schemas.CloseDoorRequest, command="CLOSE", timestamp=datetime.now()) crud.record_door_access_log(db, log_entry) - crud.record_user_connection(db, current_user, datetime.now()) + #crud.record_user_connection(db, current_user, datetime.now()) return device @@ -145,7 +145,7 @@ def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(), db: data={"sub": form_data.username}, expires_delta=timedelta(minutes=15) ) crud.set_user_last_token(db, form_data.username, access_token) - crud.record_user_connection(db, user, datetime.now()) + #crud.record_user_connection(db, user, datetime.now()) return {"access_token": access_token, "token_type": "bearer"} @app.get("/users/acesslist/", response_model=List[schemas.RoomOverview], tags=['Users']) @@ -169,7 +169,7 @@ def get_iot_access_list_for_user(db: Session = Depends(get_db), current_user: sc smoke_sensor_reading=sensors.smoke_sensor_reading ) access_list.append(entry) - crud.record_user_connection(db, user, datetime.now()) + #crud.record_user_connection(db, user, datetime.now()) return access_list @app.get("/admin/users/", response_model=List[schemas.User], tags=['Admin'])