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

Feature/back to collection #1167

Merged
merged 7 commits into from
Jul 9, 2024
Merged

Conversation

BeritJanssen
Copy link
Collaborator

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 the toontjehoger_home rules file in the backend and the ToontjeHoger frontend component, which as of now aren't used anymore. ✌️

@drikusroor drikusroor assigned drikusroor and unassigned drikusroor Jul 2, 2024
Copy link
Contributor

@drikusroor drikusroor left a 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

Comment on lines 14 to 23
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}'
Copy link
Contributor

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)

@BeritJanssen BeritJanssen merged commit 6126239 into develop Jul 9, 2024
12 checks passed
@BeritJanssen BeritJanssen deleted the feature/back-to-collection branch July 9, 2024 12:41
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.

Remove hard-coded link from ToontjeHoger(Kids) rules
2 participants