more services added
This commit is contained in:
@@ -22,7 +22,7 @@ class Configs(BaseSettings):
|
||||
EMAIL_HOST: str = ""
|
||||
DATETIME_FORMAT: str = ""
|
||||
FORGOT_LINK: str = ""
|
||||
ALLOW_ORIGINS: list = ["http://localhost:3000", "http://localhost:3001"]
|
||||
ALLOW_ORIGINS: list = ["http://localhost:3000", "http://localhost:3001", "http://localhost:3001/api", "http://localhost:3001/api/"]
|
||||
VERSION: str = "0.1.001"
|
||||
DESCRIPTION: str = ""
|
||||
|
||||
|
||||
@@ -35,10 +35,6 @@ class EventCluster:
|
||||
from schemas import Events, EndpointRestriction
|
||||
|
||||
with Events.new_session() as db_session:
|
||||
# if to_save_endpoint := EndpointRestriction.filter_one(
|
||||
# EndpointRestriction.operation_uu_id == self.endpoint_uu_id,
|
||||
# db=db_session,
|
||||
# ).data:
|
||||
Events.set_session(db_session)
|
||||
EndpointRestriction.set_session(db_session)
|
||||
|
||||
@@ -55,27 +51,14 @@ class EventCluster:
|
||||
is_confirmed=True,
|
||||
)
|
||||
print('set_events_to_database event_dict_to_save', event_dict_to_save)
|
||||
|
||||
# event_found = Events.filter_one(
|
||||
# Events.function_code == event_dict_to_save["function_code"],
|
||||
# db=db_session,
|
||||
# ).data
|
||||
# if event_found:
|
||||
# event_found.update(**event_dict_to_save)
|
||||
# event_found.save(db=db_session)
|
||||
# else:
|
||||
# event_to_save_database = Events.find_or_create(
|
||||
# **event_dict_to_save,
|
||||
# include_args=[
|
||||
# Events.function_code,
|
||||
# Events.function_class,
|
||||
# Events.endpoint_code,
|
||||
# Events.endpoint_uu_id,
|
||||
# ]
|
||||
# )
|
||||
# if event_to_save_database.meta_data.created:
|
||||
# print(f"UUID: {event_to_save_database.uu_id} event is saved to {to_save_endpoint.uu_id}")
|
||||
# event_to_save_database.save(db=db_session)
|
||||
check_event = Events.query.filter(Events.endpoint_uu_id == event_dict_to_save["endpoint_uu_id"]).first()
|
||||
if check_event:
|
||||
check_event.update(**event_dict_to_save)
|
||||
check_event.save()
|
||||
else:
|
||||
event_created = Events.create(**event_dict_to_save)
|
||||
print(f"UUID: {event_created.uu_id} event is saved to {to_save_endpoint.uu_id}")
|
||||
event_created.save()
|
||||
|
||||
def match_event(self, event_key: str) -> "Event":
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user