From 573bd15db9ebac13cada3b0276d09cc39c776d41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Pedreira=20Ant=C3=B3n?= <10578165+mpedreira@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:53:08 +0100 Subject: [PATCH] Fix: Code Clean --- app/api/api_v1/endpoints/entrance.py | 8 ++++---- app/classes/adapters/config_aws.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/api_v1/endpoints/entrance.py b/app/api/api_v1/endpoints/entrance.py index 2c6b428..8567e74 100644 --- a/app/api/api_v1/endpoints/entrance.py +++ b/app/api/api_v1/endpoints/entrance.py @@ -1,9 +1,9 @@ -# pylint: disable=E0401 +# pylint: disable=E0401,R0914 """ Saves data of the entrance and exit of the employee """ -from fastapi import APIRouter from datetime import datetime +from fastapi import APIRouter from boto3.dynamodb.conditions import Key from app.classes.adapters.database_dynamo_aws import DatabaseDynamoAWS from app.classes.adapters.config_aws import ConfigAWS @@ -55,11 +55,11 @@ def set_entrance(person: str): key = {"day": day, "person": person} diference = salida - entrada seconds = int(diference.total_seconds()) - UPDATE_EXPRESSION = "SET salida = :salida, working_seconds = :working_seconds" + update_expresion = "SET salida = :salida, working_seconds = :working_seconds" expression_attribute_values = { ":salida": hour, ":working_seconds": seconds} # Nuevo valor para Edad result = database_instance.update_item( - key, UPDATE_EXPRESSION, expression_attribute_values) + key, update_expresion, expression_attribute_values) return result data = { 'day': day, # Clave primaria obligatoria diff --git a/app/classes/adapters/config_aws.py b/app/classes/adapters/config_aws.py index 5660a6f..e181a6b 100644 --- a/app/classes/adapters/config_aws.py +++ b/app/classes/adapters/config_aws.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# pylint: disable=C0301,R0903,E0401 +# pylint: disable=C0301,R0903,E0401,R0902 # -*- coding: utf-8 -*- """Module for static configuration of Claroty"""