-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature/back to collection #1167
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice that we don't have to worry about using the "correct" thkids slug anymore
backend/experiment/actions/utils.py
Outdated
def get_current_collection_url(session: Session) -> str: | ||
collection_slug = session.load_json_data().get(COLLECTION_KEY) | ||
if not collection_slug: | ||
return None | ||
|
||
if session.participant.participant_id_url: | ||
participant_id_url = session.participant.participant_id_url | ||
redirect_url = f'/collection/{collection_slug}?participant_id_url={participant_id_url}' | ||
return f'/collection/{collection_slug}?participant_id_url={participant_id_url}' | ||
else: | ||
redirect_url = f'/collection/{collection_slug}' | ||
return f'/collection/{collection_slug}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good function for a unit test or three (no collection slug, session with participant id url, and else)
Resolves #1153: use the Django session data to set the link to return to the collection. Additional advantage is that also a (purely hypothetical)
participant_id
will be conserved. The branch also does some cleanup by removing thetoontjehoger_home
rules file in the backend and theToontjeHoger
frontend component, which as of now aren't used anymore. ✌️