Clean up
This commit is contained in:
@@ -351,7 +351,6 @@ origins = [
|
||||
|
||||
'http://dev-cmsc.oneskyit.local:5000',
|
||||
'http://dev-idaa.oneskyit.local:5000',
|
||||
'http://dev-idaa.oneskyit.local:5000',
|
||||
'http://dev-ishlt.oneskyit.local:5000',
|
||||
|
||||
'http://cmsc.oneskyit.local:5000',
|
||||
|
||||
@@ -581,9 +581,13 @@ def create_update_person_obj_v4b(
|
||||
log.info(f'User data was found. Create a new User and link it to the new Person or update existing User. Person ID: {person_id}')
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
user_obj = person_obj.user
|
||||
user_id = person_obj.user_id
|
||||
update_person_obj = False
|
||||
log.debug(user_obj)
|
||||
if user_id := person_obj.user_id : pass
|
||||
elif user_id := user_obj.id: pass
|
||||
elif user_id := person_obj.user_id_random : pass # This is because of the person model and not wanting to create an import loop for user model
|
||||
elif user_id := user_obj.id_random: pass # This is because of the person model and not wanting to create an import loop for user model
|
||||
else: user_id = None
|
||||
update_person_obj = False
|
||||
if user_id:
|
||||
log.warning('User ID found. This is not expected, but should be ok.')
|
||||
# from app.methods.user_methods import update_user_obj_v3
|
||||
|
||||
@@ -12,7 +12,7 @@ from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
from app.models.contact_models import Contact_Base
|
||||
from app.models.membership_person_models import Membership_Person_Base
|
||||
from app.models.organization_models import Organization_Base
|
||||
# from app.models.user_models import User_Base
|
||||
from app.models.user_models import User_Base
|
||||
|
||||
|
||||
# ### BEGIN ### API Person Models ### Person_Base() ###
|
||||
@@ -130,7 +130,9 @@ class Person_Base(BaseModel):
|
||||
order_cart: Optional[dict] # Order_Cart_Base() # Priority l2
|
||||
organization: Optional[Union[Organization_Base, None]]
|
||||
post_list: Optional[list] # Post_Base() # Priority l1
|
||||
user: Optional[dict] # Optional[Union[User_Base, None]]
|
||||
# user: Optional[dict] # Optional[Union[User_Base, None]]
|
||||
# from app.models.user_models import User_Base
|
||||
user: Optional[Union[User_Base, None]]
|
||||
|
||||
_processed_at: datetime.datetime = PrivateAttr(default_factory=datetime.datetime.now)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from app.models.common_field_schema import base_fields, default_num_bytes
|
||||
# from app.models.contact_models import Contact_Base
|
||||
# from app.models.membership_person_models import Membership_Person_Base
|
||||
from app.models.organization_models import Organization_Base
|
||||
from app.models.person_models import Person_Base # Causes circular import
|
||||
# from app.models.person_models import Person_Base # Causes circular import
|
||||
# from app.models.user_role_models import User_Role_Base
|
||||
|
||||
|
||||
@@ -210,8 +210,8 @@ class User_Out_Base(BaseModel):
|
||||
order_list: Optional[list] # Order_Base() # Priority l2
|
||||
order_cart_list: Optional[list] # Order_Base() # Priority l2
|
||||
organization: Optional[Union[Organization_Base, None]] # Organization_Base() # Priority l3
|
||||
# person: Optional[dict] # Person_Base() # Priority l2
|
||||
person: Optional[Union[Person_Base, None]]
|
||||
person: Optional[dict] # Person_Base() # Priority l2
|
||||
# person: Optional[Union[Person_Base, None]]
|
||||
post_list: Optional[list] # Post_Base() # Priority l1
|
||||
user_role_list: Optional[list] = Field(
|
||||
alias = 'role_list'
|
||||
@@ -296,8 +296,8 @@ class User_Base(BaseModel):
|
||||
order_list: Optional[list] # Order_Base() # Priority l2
|
||||
order_cart_list: Optional[list] # Order_Base() # Priority l2
|
||||
organization: Optional[Union[Organization_Base, None]] # Organization_Base() # Priority l3
|
||||
# person: Optional[dict] # Person_Base() # Priority l2
|
||||
person: Optional[Union[Person_Base, None]]
|
||||
person: Optional[dict] # Person_Base() # Priority l2
|
||||
# person: Optional[Union[Person_Base, None]]
|
||||
post_list: Optional[list] # Post_Base() # Priority l1
|
||||
user_role_list: Optional[list] = Field(
|
||||
alias = 'role_list'
|
||||
|
||||
Reference in New Issue
Block a user