File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import sqlalchemy .exc
22from sqlalchemy .orm import Session
33
4- from models import payment
4+ from models . payment import Organization
55from schemas .schema import CreateCompany
66
77
@@ -10,7 +10,7 @@ class CompanyExistException(Exception):
1010
1111
1212def create_company (db : Session , company : CreateCompany ):
13- db_item = payment . Organization (** company .dict ())
13+ db_item = Organization (** company .dict ())
1414 try :
1515 db .add (db_item )
1616 db .commit ()
@@ -21,7 +21,7 @@ def create_company(db: Session, company: CreateCompany):
2121
2222
2323def delete_company (db : Session , organization_id : int ):
24- db_organization = db .query (payment . Organization ).get (organization_id )
24+ db_organization = db .query (Organization ).get (organization_id )
2525 if db_organization :
2626 db .delete (db_organization )
2727 db .commit ()
@@ -31,5 +31,5 @@ def delete_company(db: Session, organization_id: int):
3131
3232
3333def filter_company_by_name (db : Session , company_name : str ):
34- company = db .query (payment . Organization ).filter_by (name = company_name )
34+ company = db .query (Organization ).filter_by (name = company_name )
3535 return company
You can’t perform that action at this time.
0 commit comments