Fix signals

This commit is contained in:
cuom1999 2024-02-26 15:47:17 -06:00
parent 2189de9433
commit 85bee3e77c

View file

@ -78,7 +78,7 @@ def profile_update(sender, instance, **kwargs):
return return
cache.delete_many( cache.delete_many(
[make_template_fragment_key("user_about", (instance.id))] [make_template_fragment_key("user_about", (instance.id,))]
+ [ + [
make_template_fragment_key("org_member_count", (org_id,)) make_template_fragment_key("org_member_count", (org_id,))
for org_id in instance.organizations.values_list("id", flat=True) for org_id in instance.organizations.values_list("id", flat=True)
@ -93,7 +93,7 @@ def contest_update(sender, instance, **kwargs):
cache.delete_many( cache.delete_many(
["generated-meta-contest:%d" % instance.id] ["generated-meta-contest:%d" % instance.id]
+ [make_template_fragment_key("contest_html", (instance.id))] + [make_template_fragment_key("contest_html", (instance.id,))]
) )
@ -127,8 +127,8 @@ def post_update(sender, instance, **kwargs):
"blog_slug:%d" % instance.id, "blog_slug:%d" % instance.id,
"blog_feed:%d" % instance.id, "blog_feed:%d" % instance.id,
] ]
+ [make_template_fragment_key("post_content", (instance.id,))]
) )
cache.delete_many([make_template_fragment_key("post_content", (instance.id))])
@receiver(post_delete, sender=Submission) @receiver(post_delete, sender=Submission)
@ -145,7 +145,7 @@ def contest_submission_delete(sender, instance, **kwargs):
@receiver(post_save, sender=Organization) @receiver(post_save, sender=Organization)
def organization_update(sender, instance, **kwargs): def organization_update(sender, instance, **kwargs):
cache.delete_many([make_template_fragment_key("organization_html", (instance.id))]) cache.delete_many([make_template_fragment_key("organization_html", (instance.id,))])
_misc_config_i18n = [code for code, _ in settings.LANGUAGES] _misc_config_i18n = [code for code, _ in settings.LANGUAGES]