alchemy functions updated
This commit is contained in:
@@ -6,7 +6,7 @@ from fastapi import HTTPException
|
||||
|
||||
from databases.sql_models.core_mixin import CrudCollection
|
||||
from databases.extensions import SelectAction, SelectActionWithEmployee
|
||||
from databases import Employees, Duties
|
||||
from databases.extensions.auth import UserLoginModule
|
||||
|
||||
from sqlalchemy import (
|
||||
String,
|
||||
@@ -24,7 +24,6 @@ from sqlalchemy import (
|
||||
from sqlalchemy.orm import mapped_column, relationship, Mapped
|
||||
|
||||
from api_validations.validations_request import InsertUsers, InsertPerson
|
||||
from databases.extensions.auth import UserLoginModule
|
||||
|
||||
|
||||
class UsersTokens(CrudCollection):
|
||||
@@ -219,7 +218,7 @@ class Users(CrudCollection, UserLoginModule, SelectAction):
|
||||
# }
|
||||
|
||||
def get_employee_and_duty_details(self):
|
||||
|
||||
from databases import Employees, Duties
|
||||
found_person = People.find_one(id=self.person_id)
|
||||
found_employees = Employees.filter_by_active(
|
||||
people_id=found_person.id, is_confirmed=True
|
||||
@@ -381,6 +380,7 @@ class People(CrudCollection, SelectAction):
|
||||
|
||||
@classmethod
|
||||
def create_action(cls, data: InsertPerson, token):
|
||||
from databases import Employees, Duties
|
||||
token_duties_id, token_company_id = (
|
||||
token.selected_company.duty_id,
|
||||
token.selected_company.company_id,
|
||||
|
||||
Reference in New Issue
Block a user