This commit is contained in:
cuom1999 2022-09-04 12:32:10 -05:00
parent ba75b5c086
commit 9d9d171209
3 changed files with 23 additions and 11 deletions

View file

@ -176,7 +176,12 @@ class LogEntryAdmin(admin.ModelAdmin):
"object_link",
"diff_link",
)
search_fields = ("object_repr", "change_message", "user__username", "content_type__model")
search_fields = (
"object_repr",
"change_message",
"user__username",
"content_type__model",
)
list_filter = (UserListFilter, "content_type")
list_display_links = None
actions = None
@ -227,4 +232,4 @@ class LogEntryAdmin(admin.ModelAdmin):
diff_link.short_description = _("diff")
def queryset(self, request):
return super().queryset(request).prefetch_related("content_type")
return super().queryset(request).prefetch_related("content_type")

View file

@ -394,10 +394,13 @@ class ProblemAdmin(CompareVersionAdmin):
admins = Profile.objects.filter(user__is_superuser=True).all()
users = users.union(users, admins)
link = reverse_lazy("admin:judge_problem_change", args=(obj.id,))
html = f"<a href=\"{link}\">{obj.name}</a>"
html = f'<a href="{link}">{obj.name}</a>'
for user in users:
notification = Notification(
owner=user, html_link=html, category="Problem public: " + str(obj.is_public), author=request.profile
owner=user,
html_link=html,
category="Problem public: " + str(obj.is_public),
author=request.profile,
)
notification.save()