Re-enable delete session delete view
This commit is contained in:
parent
880ea93424
commit
15997bd5af
|
@ -42,11 +42,11 @@ urlpatterns = [
|
|||
{"template": "list_sessions.html#session-row"},
|
||||
name="list_sessions_end_session",
|
||||
),
|
||||
# path(
|
||||
# "session/<int:session_id>/delete",
|
||||
# views.delete_session,
|
||||
# name="delete_session",
|
||||
# ),
|
||||
path(
|
||||
"session/<int:session_id>/delete",
|
||||
views.delete_session,
|
||||
name="delete_session",
|
||||
),
|
||||
path(
|
||||
"purchase/<int:purchase_id>/delete",
|
||||
views.delete_purchase,
|
||||
|
|
|
@ -283,11 +283,11 @@ def end_session(request, session_id: int, template: str = ""):
|
|||
return render(request, template, context)
|
||||
return redirect("list_sessions")
|
||||
|
||||
|
||||
# def delete_session(request, session_id=None):
|
||||
# session = Session.objects.get(id=session_id)
|
||||
# session.delete()
|
||||
# return redirect("list_sessions")
|
||||
@login_required
|
||||
def delete_session(request, session_id=None):
|
||||
session = get_object_or_404(Session, id=session_id)
|
||||
session.delete()
|
||||
return redirect("list_sessions")
|
||||
|
||||
|
||||
@login_required
|
||||
|
|
Loading…
Reference in New Issue