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

Take both a list of strings and comma separated string in get_roles #6600

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

marcospri
Copy link
Member

For:

LTI1.1 provides a comma separated list of roles while LTI1.3 provides a list.

The launch LTIParams provides an abstraction for this, always returning the LTI1.1 version.

To allow using get_roles outside a launch context without having to needlessly convert between the two formats allow the method to take roles in both formats.


# Pylint is confused about the `in_` for some reason
Copy link
Member Author

Choose a reason for hiding this comment

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

I guess there was some pylint pragma here but not anymore 🤷

LTI1.1 provides a comma separated list of roles while LTI1.3 provides a
list.

The launch LTIParams provides an abstraction for this, always returning
the LTI1.1 version.

To allow using get_roles outside a launch context without having to
needlessly convert between the two formats allow the method to take
roles in both formats.
@@ -22,7 +23,10 @@ def test_get_roles(self, svc, existing_roles):
role_descriptions.append(existing_roles[0].value)
role_descriptions.extend(new_roles)

roles = svc.get_roles(", ".join(role_descriptions))
if roles_as_string:
# pylint: disable=redefined-variable-type
Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we are redefining the type of a variable here pylint, but that's the point here so adding a disable

@marcospri marcospri marked this pull request as ready for review August 26, 2024 08:53
@marcospri marcospri requested a review from acelaya August 26, 2024 08:53
@marcospri marcospri merged commit d7c7aa2 into main Aug 27, 2024
9 checks passed
@marcospri marcospri deleted the refactor-lti-roles-get branch August 27, 2024 08:34
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