diff --git a/dmoj/settings.py b/dmoj/settings.py index c88af67..132bd7d 100644 --- a/dmoj/settings.py +++ b/dmoj/settings.py @@ -212,10 +212,8 @@ else: ], }, ("judge.BlogPost", "fa-rss-square"), - ("judge.Comment", "fa-comment-o"), ("judge.Ticket", "fa-exclamation-circle"), - ("flatpages.FlatPage", "fa-file-text-o"), - ("judge.Solution", "fa-pencil"), + ("admin.LogEntry", "fa-empire"), ], "dashboard": { "breadcrumbs": True, diff --git a/judge/admin/interface.py b/judge/admin/interface.py index 581e5b8..8e61536 100644 --- a/judge/admin/interface.py +++ b/judge/admin/interface.py @@ -176,7 +176,7 @@ class LogEntryAdmin(admin.ModelAdmin): "object_link", "diff_link", ) - search_fields = ("object_repr", "change_message") + search_fields = ("object_repr", "change_message", "user__username", "content_type__model") list_filter = (UserListFilter, "content_type") list_display_links = None actions = None diff --git a/judge/admin/problem.py b/judge/admin/problem.py index e5a036d..f770d6b 100644 --- a/judge/admin/problem.py +++ b/judge/admin/problem.py @@ -10,6 +10,7 @@ from django.urls import reverse_lazy from django.utils.html import format_html from django.utils.translation import gettext, gettext_lazy as _, ungettext from django_ace import AceWidget +from django.utils import timezone from reversion.admin import VersionAdmin from reversion_compare.admin import CompareVersionAdmin @@ -58,6 +59,9 @@ class ProblemForm(ModelForm): memory_unit = self.cleaned_data.get("memory_unit", "KB") if memory_unit == "MB": self.cleaned_data["memory_limit"] *= 1024 + date = self.cleaned_data.get("date") + if not date or date > timezone.now(): + self.cleaned_data["date"] = timezone.now() return self.cleaned_data class Meta: @@ -237,11 +241,12 @@ class ProblemAdmin(CompareVersionAdmin): "code", "name", "show_authors", + "date", "points", "is_public", "show_public", ] - ordering = ["code"] + ordering = ["-date"] search_fields = ( "code", "name",