Skip to content

Commit

Permalink
Add changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey committed Oct 2, 2024
1 parent bfd933a commit f6e7f19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion moonstreamapi/moonstreamapi/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ def create_resource_for_user(
return resource


def chekc_user_resource_access(
def check_user_resource_access(
customer_id: uuid.UUID,
user_token: uuid.UUID,
) -> Optional[BugoutResource]:
Expand Down
16 changes: 8 additions & 8 deletions moonstreamapi/moonstreamapi/routes/subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
EntityJournalNotFoundException,
apply_moonworm_tasks,
check_if_smart_contract,
chekc_user_resource_access,
check_user_resource_access,
get_entity_subscription_journal_id,
get_list_of_support_interfaces,
get_moonworm_tasks,
Expand Down Expand Up @@ -104,15 +104,15 @@ async def add_subscription_handler(

if customer_id is not None:

results = chekc_user_resource_access(
results = check_user_resource_access(
customer_id=customer_id,
user_token=token,
)

if results is None:
raise MoonstreamHTTPException(
status_code=403,
detail="User has no access to this customer",
status_code=404,
detail="Not found customer",
)

customer_instance_name = results.resource_data["name"]
Expand Down Expand Up @@ -474,15 +474,15 @@ async def update_subscriptions_handler(

if customer_id is not None:

results = chekc_user_resource_access(
results = check_user_resource_access(
customer_id=customer_id,
user_token=token,
)

if results is None:
raise MoonstreamHTTPException(
status_code=403,
detail="User has no access to this customer",
status_code=404,
detail="Not found customer",
)

try:
Expand Down Expand Up @@ -638,7 +638,7 @@ async def update_subscriptions_handler(
f"{key}:{value}"
for tag in subscription_required_fields
for key, value in tag.items()
if key not in MOONSTREAM_ENTITIES_RESERVED_TAGS and key != "instance_name"
if key not in MOONSTREAM_ENTITIES_RESERVED_TAGS or key == "instance_name"
]

return data.SubscriptionResourceData(
Expand Down

0 comments on commit f6e7f19

Please sign in to comment.