Card Component implemented
This commit is contained in:
@@ -525,22 +525,23 @@ def create_application_defaults(db_session):
|
||||
sup_manager_employee.password_token = PasswordModule.generate_refresher_token()
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
existing_record = mongo_engine.find_one({"user_uu_id": str(sup_manager_employee.uu_id)})
|
||||
|
||||
if not existing_record:
|
||||
print('insert sup existing record',existing_record)
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(sup_manager_employee.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"other_domains_list": [main_domain, "management.com.tr"],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
else:
|
||||
print('update sup existing record',existing_record)
|
||||
# Optionally update the existing record if needed
|
||||
mongo_engine.update_one(
|
||||
{"user_uu_id": str(sup_manager_employee.uu_id)},
|
||||
{"$set": {
|
||||
"other_domains_list": [main_domain],
|
||||
"other_domains_list": [main_domain, "management.com.tr"],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}}
|
||||
|
||||
@@ -239,34 +239,67 @@ def create_occupant_defaults(db_session):
|
||||
user_tenant.password_token = PasswordModule.generate_refresher_token()
|
||||
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_build_manager.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
existing_record = mongo_engine.find_one({"user_uu_id": str(user_build_manager.uu_id)})
|
||||
if not existing_record:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_build_manager.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
else:
|
||||
mongo_engine.update_one(
|
||||
{"user_uu_id": str(user_build_manager.uu_id)},
|
||||
{"$set": {
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}}
|
||||
)
|
||||
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_owner.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
existing_record = mongo_engine.find_one({"user_uu_id": str(user_owner.uu_id)})
|
||||
if not existing_record:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_owner.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
else:
|
||||
mongo_engine.update_one(
|
||||
{"user_uu_id": str(user_owner.uu_id)},
|
||||
{"$set": {
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}}
|
||||
)
|
||||
|
||||
with mongo_handler.collection(collection_name) as mongo_engine:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_tenant.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
existing_record = mongo_engine.find_one({"user_uu_id": str(user_tenant.uu_id)})
|
||||
if not existing_record:
|
||||
mongo_engine.insert_one(
|
||||
document={
|
||||
"user_uu_id": str(user_tenant.uu_id),
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}
|
||||
)
|
||||
else:
|
||||
mongo_engine.update_one(
|
||||
{"user_uu_id": str(user_tenant.uu_id)},
|
||||
{"$set": {
|
||||
"other_domains_list": [main_domain],
|
||||
"main_domain": main_domain,
|
||||
"modified_at": arrow.now().timestamp(),
|
||||
}}
|
||||
)
|
||||
|
||||
created_build_living_space_prs = BuildLivingSpace.find_or_create(
|
||||
build_id=created_build.id,
|
||||
|
||||
Reference in New Issue
Block a user