From 18024584081ac576eefa393e054ad939bd0969b2 Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Fri, 3 Jun 2022 14:01:49 -0500 Subject: [PATCH] Fix bug --- judge/views/problem.py | 3 +- templates/problem/list-base.html | 200 +------------------------- templates/problem/recent-attempt.html | 40 +++--- 3 files changed, 26 insertions(+), 217 deletions(-) diff --git a/judge/views/problem.py b/judge/views/problem.py index 1035717..aa913d8 100644 --- a/judge/views/problem.py +++ b/judge/views/problem.py @@ -512,7 +512,7 @@ class ProblemList(QueryStringSortMixin, TitleMixin, SolvedProblemMixin, ListView def get_org_query(self, query): if not self.profile: - return None + return [] return [ i for i in query @@ -541,6 +541,7 @@ class ProblemList(QueryStringSortMixin, TitleMixin, SolvedProblemMixin, ListView ) if self.org_query: self.org_query = self.get_org_query(self.org_query) + print(self.org_query) queryset = queryset.filter( Q(organizations__in=self.org_query) | Q(contests__contest__organizations__in=self.org_query) diff --git a/templates/problem/list-base.html b/templates/problem/list-base.html index 2eabfe6..d97dc83 100644 --- a/templates/problem/list-base.html +++ b/templates/problem/list-base.html @@ -55,13 +55,6 @@ @@ -251,195 +246,6 @@ {% endif %} {% endblock %} -{% block middle_content %} - {% if in_contest_mode or page_type == 'list' %} -
- - - - {% if request.in_contest_mode %} - {% if request.user.is_authenticated %} - - {% endif %} - - - {% if show_types %} - - {% endif %} - - - {% else %} - {% if request.user.is_authenticated %} - - {% endif %} - - - - {% if show_types %} - - {% endif %} - - - - {% if show_editorial %} - - {% endif %} - {% endif %} - - - - {% for problem in object_list %} - - {% if request.user.is_authenticated %} - {% if problem.id in completed_problem_ids %} - - {% elif problem.id in attempted_problems %} - - {% else %} - - {% endif %} - {% endif %} - - - {% if not request.in_contest_mode %} - - {% endif %} - {% if show_types %} - - {% endif %} - - {% if not request.in_contest_mode %} - - {% endif %} - - {% if show_editorial%} - - {% endif %} - - {% endfor %} - -
{{ _('Problem') }}{{ _('Problem code') }}{{ _('Types') }}{{ _('Points') }}{{ _('Users') }} - {{ sort_order.solved }} - - - {{ _('Problem') }}{{ sort_order.name }} - - {{ _('Problem code') }} - - {{ _('Category') }}{{ sort_order.group }} - - {{ _('Types') }}{{ sort_order.type }} - - {{ _('Points') }}{{ sort_order.points }} - - {{ _('AC %%') }}{{ sort_order.ac_rate }} - - {{ _('Users') }}{{ sort_order.user_count }} - - {{_('Editorial')}} -
- - {% if problem.is_public or request.in_contest_mode %} - - {% else %} - - {% endif %} - - - - {% if problem.is_public or request.in_contest_mode %} - - {% else %} - - {% endif %} - - - {% if problem.is_public or request.in_contest_mode %} - - {% else %} - - {% endif %} - - {{ problem.i18n_name }} - - {{ problem.code }} - {{ problem.group.full_name }} - {% for type in problem.types_list %} - {{ type }}{% if not loop.last %}, {% endif %} - {% endfor %} - {{ problem.points|floatformat }}{% if problem.partial %}p{% endif %}{{ problem.ac_rate|floatformat(1) }}% - - {% if not request.in_contest_mode or not hide_contest_scoreboard %} - {{ problem.user_count }} - {% else %} - ??? - {% endif %} - - - {% if problem.has_public_editorial %} - {{ _('Editorial') }} - {% endif %} -
- {% if request.in_contest_mode and request.participation.contest.use_clarifications %} -

- {% if can_edit_contest %} -
- {{_('Add clarifications')}} -
- {% endif %} - {% if has_clarifications %} -
- {{_('Clarifications')}}
- - - - - - - {% for clarification in clarifications %} - - - - - - {% endfor %} -
{{_('Problem')}}{{_('Time')}}{{_('Description')}}
- - {{ clarification.problem.name }} - - {{ relative_time(clarification.date) }}

{{clarification.description}}

- {% else %} -

- {{ _('No clarifications have been made at this time.') }} -

- {% endif %} - {% endif %} - -
- {% elif page_type == 'feed' %} -
- - {{_('FOR YOU')}} - - - {{_('NEW')}} - - {% if request.user.has_perm('judge.suggest_problem_changes') %} - - {{_('VOLUNTEER')}} - - {% endif %} -
- {% for problem in problems %} - {% include "problem/feed.html" %} - {% endfor %} - {% endif %} - {% if page_obj.num_pages > 1 %} -
{% include "list-pages.html" %}
- {% endif %} -{% endblock %} - {% block right_sidebar %} {% if not request.in_contest_mode %}