sei-ec-remote / team-project-issues

0 stars 0 forks source link

Issue with out redirect for assoc and assoc #179

Closed da1dude closed 9 months ago

da1dude commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

What is the problem you are trying to solve? Fails on redirect. We have attempted changing the reidirect URL to a few different pages.

Expected behavior A clear and concise description of what you expected to happen.

Redirect refresh of the details page moving the associated Rx item.

What is the actual behavior? A clear and concise description of what actually happened.

The Database updates but the refresh doesnt occur. Manual refresh updates that page correctly.

Post any code you think might be relevant (one fenced block per file)


def assoc_rx(request, checkin_id, rx_id):
    # Note that you can pass a rx's id instead of the whole rx object
    Checkin.objects.get(id=checkin_id).rxs.add(rx_id)
    return redirect('detail', checkin_id=checkin_id)

def unassoc_rx(request, checkin_id, rx_id):
    # Note that you can pass a rx's id instead of the whole rx object
    Checkin.objects.get(id=checkin_id).rxs.remove(rx_id)
    return redirect('detail', checkin_id=checkin_id)

    # associate a toy with a cat (M:M)
    path('checkins/<int:checkin_id>/assoc_rx/<int:rx_id>/', views.assoc_rx, name='assoc_rx'),
    path('checkins/<int:checkin_id>/unassoc_rx/<int:rx_id>/', views.unassoc_rx, name='unassoc_rx'),

What is your best guess as to the source of the problem?

Unknown we stumped.

What things have you already tried to solve the problem?

Different redirects and comparing apples to applies with CatCollector.

Additional context Add any other context about the problem here.

Screenshot 2024-01-23 at 11 22 12 AM

Paste a link to your repository here https://github.com/da1dude/petdesk

da1dude commented 9 months ago

checkin_detail instead of detail in the View.

Derp