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

docs: [FC-0074] enrich docstrings following a template with more details #246

Merged
merged 8 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions openedx_filters/course_authoring/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,35 @@

class LMSPageURLRequested(OpenEdxPublicFilter):
"""
Custom class used to get lms page url filters and its custom methods.
Filter used to modify the URL of the page requested by the user.

This filter is triggered when a user loads a page in Studio that references an LMS page, allowing the filter to
modify the URL of the page requested by the user.

Filter Type:
org.openedx.course_authoring.lms.page.url.requested.v1

Trigger:
- Repository: openedx/edx-platform
- Path: cms/djangoapps/contentstore/asset_storage_handler.py
- Function or Method: get_asset_json
"""

filter_type = "org.openedx.course_authoring.lms.page.url.requested.v1"

@classmethod
def run_filter(cls, url, org):
def run_filter(cls, url: str, org: str) -> tuple[str, str]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the Returns information.

"""
Execute a filter with the signature specified.
Process the inputs using the configured pipeline steps to modify the URL of the page requested by the user.

Arguments:
url (str): the URL of the page to be modified.
org (str): Course org filter used as context data to get LMS configurations.
- url (str): the URL of the page to be modified.
- org (str): Course org filter used as context data to get LMS configurations.

Returns:
tuple[str, str]:
- str: the modified URL of the page requested by the user.
- str: the course org.
"""
data = super().run_pipeline(url=url, org=org)
return data.get("url"), data.get("org")
Loading
Loading