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

Fix 500 error on /contest/<code>/leave #1956

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions judge/views/contests.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from django.utils.timezone import make_aware
from django.utils.translation import gettext as _, gettext_lazy
from django.views.generic import ListView, TemplateView
from django.views.generic.detail import BaseDetailView, DetailView, SingleObjectMixin, View
from django.views.generic.detail import DetailView, SingleObjectMixin, View
from django.views.generic.list import BaseListView
from icalendar import Calendar as ICalendar, Event
from reversion import revisions
Expand Down Expand Up @@ -331,7 +331,7 @@ def __init__(self, *args, **kwargs):
self.fields['access_code'].widget.attrs.update({'autocomplete': 'off'})


class ContestJoin(LoginRequiredMixin, ContestMixin, BaseDetailView):
class ContestJoin(LoginRequiredMixin, ContestMixin, SingleObjectMixin, View):
def get(self, request, *args, **kwargs):
self.object = self.get_object()
return self.ask_for_access_code()
Expand Down Expand Up @@ -430,7 +430,7 @@ def ask_for_access_code(self, form=None):
})


class ContestLeave(LoginRequiredMixin, ContestMixin, BaseDetailView):
class ContestLeave(LoginRequiredMixin, ContestMixin, SingleObjectMixin, View):
def post(self, request, *args, **kwargs):
contest = self.get_object()

Expand Down