Skip to content

Commit

Permalink
Some cleanup to lessen divergence from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
otargowski committed Apr 25, 2024
1 parent f4efbca commit e154d5c
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion oioioi/base/templates/ingredients/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ <h5 class="card-title mb-0">{% trans "Menu" %}</h5>
</div>
{% endif %}
{% all_with_prefix extra_menu_bottom_ %}
</div>
</div>
3 changes: 2 additions & 1 deletion oioioi/base/templates/ingredients/navbar-user.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
<div class="dropdown">
<a href="#" id="navbar-username" class="dropdown-toggle {% if avatar %}has-avatar{% endif %}"
data-toggle="dropdown" role="button" aria-expanded="false">
{% if user.is_superuser and is_maintenance_enabled %}
{% is_maintenance_enabled as enabled %}
{% if user.is_superuser and enabled %}
<span id="maintenance-label" class="badge badge-warning"
data-toggle="tooltip" data-placement="bottom" title="{% trans "Maintenance Mode is ON" %}">
<i class="badge-short fa-solid fa-gear"></i>
Expand Down
2 changes: 1 addition & 1 deletion oioioi/clock/templates/clock/navbar-countdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only"></span>
</div>
</div>
</div>
1 change: 0 additions & 1 deletion oioioi/clock/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
app_name = 'clock'

urlpatterns = [
re_path(r'^admin/time/$', views.admin_time, name='admin_time'),
# Don't use the 'admin/' prefix, as that sometimes results in breakage.
re_path(r'^admin_time/$', views.admin_time, name='admin_time'),
]
1 change: 0 additions & 1 deletion oioioi/contests/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def recent_contests(request):
c_views = ContestView.objects.filter(user=request.real_user).select_related(
'contest'
)

c_views = c_views[: getattr(settings, 'NUM_RECENT_CONTESTS', 5)]
return [cv.contest for cv in c_views if cv.contest in visible_contests(request)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ def handle(self, *args, **options):
_("Error for user=%(user)s: user does not exist\n")
% {'user': login}
)
# less strict behaviour from original TalentSio
# ok = False
all_count -= 1
continue
ok = False
except DatabaseError as e:
# This assumes that we'll get the message in this
# encoding. It is not perfect, but much better than
Expand Down
3 changes: 1 addition & 2 deletions oioioi/problems/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from django.conf import settings
from django.contrib.auth.models import User
from django.core import validators
from django.core.cache import cache
from django.core.files.base import ContentFile
from django.core.validators import validate_slug
from django.db import models, transaction
Expand Down Expand Up @@ -117,7 +116,7 @@ class Problem(models.Model):
on_delete=models.CASCADE,
)

@property
@cached_property
def name(self):
problem_name = ProblemName.objects.filter(
problem=self, language=get_language()
Expand Down
1 change: 0 additions & 1 deletion oioioi/statistics/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from oioioi.base.utils import request_cached
from oioioi.base.permissions import make_request_condition
from oioioi.base.utils import request_cached
from oioioi.programs.controllers import ProgrammingContestController


Expand Down

0 comments on commit e154d5c

Please sign in to comment.