Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [AXIMST-26] API endpoint to return components in unit #2486

Closed

Conversation

ruzniaievdm
Copy link

@ruzniaievdm ruzniaievdm force-pushed the ruzniaievdm/feat/vertical-container-api branch from 834ab65 to 11f5728 Compare January 5, 2024 14:38
@ruzniaievdm ruzniaievdm marked this pull request as ready for review January 5, 2024 14:43
Comment on lines +53 to +61
def get_object(self, usage_key_string):
"""
Get an object by usage-id of the block
"""
try:
usage_key = UsageKey.from_string(usage_key_string)
except InvalidKeyError:
raise Http404 # lint-amnesty, pylint: disable=raise-missing-from
return usage_key
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_object(self, usage_key_string):
"""
Get an object by usage-id of the block
"""
try:
usage_key = UsageKey.from_string(usage_key_string)
except InvalidKeyError:
raise Http404 # lint-amnesty, pylint: disable=raise-missing-from
return usage_key
def get_object(self, usage_key_string):
"""
Get an object by usage-id of the block
"""
try:
usage_key = UsageKey.from_string(usage_key_string)
return usage_key
except InvalidKeyError as e:
logging.error(f"Invalid usage key: {usage_key_string}", exc_info=True)
raise Http404(f"Object not found for usage key: {usage_key_string}") from e

@monteri monteri deleted the branch ts-develop-old January 8, 2024 15:16
@monteri monteri closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants