Skip to content

Commit

Permalink
Fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
cuom1999 committed Sep 8, 2024
1 parent 88845ae commit 05ab90e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion judge/migrations/0091_compiler_message_ansi2html.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import lxml.html as lh
from django.db import migrations
from lxml.html.clean import clean_html
from lxml_html_clean import clean_html


def strip_error_html(apps, schema_editor):
Expand Down
11 changes: 10 additions & 1 deletion judge/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from django.dispatch import receiver

import judge
from judge import template_context
from judge.utils.problems import finished_submission
from .models import (
BlogPost,
Expand All @@ -25,6 +26,7 @@
Submission,
NavigationBar,
Solution,
ContestProblem,
)


Expand Down Expand Up @@ -169,9 +171,16 @@ def contest_submission_update(sender, instance, **kwargs):

@receiver(post_save, sender=NavigationBar)
def navbar_update(sender, instance, **kwargs):
judge.template_context._nav_bar.dirty()
template_context._nav_bar.dirty()


@receiver(post_save, sender=Solution)
def solution_update(sender, instance, **kwargs):
cache.delete(make_template_fragment_key("solution_content", (instance.id,)))


@receiver(post_delete, sender=ContestProblem)
def contest_problem_delete(sender, instance, **kwargs):
Submission.objects.filter(
contest_object=instance.contest, contest__isnull=True
).update(contest_object=None)
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ pymdown-extensions
mdx-breakless-lists
beautifulsoup4
pre-commit
django-ratelimit
django-ratelimit
lxml_html_clean

0 comments on commit 05ab90e

Please sign in to comment.