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

ProjectInviteCreateView GET request with query string fails for category #1510

Open
mikkonie opened this issue Nov 1, 2024 · 2 comments
Open
Assignees
Labels
app: projectroles Issue in the projectroles app bug Something isn't working help wanted Extra attention is needed

Comments

@mikkonie
Copy link
Collaborator

mikkonie commented Nov 1, 2024

In RoleAssignmentCreateView, typing an email address in the user field provides a link redirecting to ProjectInviteCreateView.

This works for projects, but currently fails with a 404 when done from inside a category.

This needs to be fixed and also added to tests.

Update: This also fails with a direct request to ProjectInviteCreateView if the UUID is for a category and a query string is included. See comments.

Update 2: Fixed for now with a workaround, see comments.

@mikkonie mikkonie added bug Something isn't working app: projectroles Issue in the projectroles app labels Nov 1, 2024
@mikkonie mikkonie added this to the v1.0.3 milestone Nov 1, 2024
@mikkonie mikkonie self-assigned this Nov 1, 2024
@mikkonie
Copy link
Collaborator Author

mikkonie commented Nov 4, 2024

This one is very strange. It must be something very simple and dumb, but I'm confused.

These URLs work:

/project/invites/create/{PROJECT_UUID}
/project/invites/create/{PROJECT_UUID}?e=user%40example.com&r=4
/project/invites/create/{CATEGORY_UUID}

However, this fails:

/project/invites/create/{CATEGORY_UUID}?e=user%40example.com&r=4

What's more, it fails with the Django URLconf error of not finding the URL pattern in config.urls.

However, /project/invites/create/{PROJECT_UUID}?e=user%40example.com&r=4 and /project/invites/create/{CATEGORY_UUID}?e=user%40example.com&r=4 are supposed to the same pattern, as categories and projects are objects of the same Project class.

Does the query string break this pattern somehow? I've never seen this before.

@mikkonie mikkonie changed the title Invite redirect from RoleAssignmentCreateView fails in category ProjectInviteCreateView GET request with query string fails for category Nov 4, 2024
@mikkonie
Copy link
Collaborator Author

mikkonie commented Nov 4, 2024

I fixed this for v1.0.3 by adding a workaround, where I include the query string in the URL route. However, this should not be required! Query strings should not go to routes as url kwargs.

I'm leaving this issue open as it is quite baffling. If anyone has ideas for the cause and a proper fix, please let me know.

Oh also, this happens on both Django 3.2 and 4.2. Originally reported in SODAR v0.15..

@mikkonie mikkonie removed this from the v1.0.3 milestone Nov 4, 2024
@mikkonie mikkonie added help wanted Extra attention is needed ongoing Ongoing issue, needs observation or pending on other projects and removed ongoing Ongoing issue, needs observation or pending on other projects labels Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: projectroles Issue in the projectroles app bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant