endpoint_restriction_available updated
This commit is contained in:
parent
1c6fffd29d
commit
17a6609a8f
|
|
@ -76,6 +76,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
|||
EndpointRestriction.endpoint_name.ilike(f"%{data.endpoint}%"),
|
||||
system=True,
|
||||
).data
|
||||
print("endpoint", endpoint)
|
||||
if not endpoint:
|
||||
EndpointRestriction.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
|
|
@ -84,9 +85,9 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
|||
data={},
|
||||
)
|
||||
event = Events.filter_one(Events.endpoint_id == endpoint.id).data
|
||||
service = Service2Events.filter_one(
|
||||
Service2Events.event_id == event.id,
|
||||
).data
|
||||
print("event", event)
|
||||
service = Service2Events.filter_one(Service2Events.event_id == event.id).data
|
||||
print("service", service)
|
||||
if isinstance(token_dict, OccupantTokenObject):
|
||||
event_occupant = Event2Occupant.filter_one(
|
||||
Event2Occupant.event_service_id == service.id,
|
||||
|
|
@ -109,6 +110,7 @@ def endpoint_restriction_available(request: Request, data: CheckEndpointAccess):
|
|||
Event2Employee.event_service_id == service.id,
|
||||
Event2Employee.employee_id == token_dict.selected_company.employee_id,
|
||||
).data
|
||||
print("event_employee", event_employee)
|
||||
if not event_employee:
|
||||
EndpointRestriction.raise_http_exception(
|
||||
status_code="HTTP_404_NOT_FOUND",
|
||||
|
|
|
|||
Loading…
Reference in New Issue