Commit 080b8f53 authored by Bruno Antunes Magrini's avatar Bruno Antunes Magrini
Browse files

Remove forum when deleting course

parent dd3b7188
from django.db.models.signals import post_save
from django.db.models.signals import post_save, post_delete
from django.dispatch import receiver
from base64 import urlsafe_b64encode as ub64
......@@ -54,3 +54,8 @@ def course_created_or_updated(sender, created, instance, **kwargs):
forum.title_pt_br = instance.name_pt_br
forum.save()
# @receiver(post_delete, sender=Course)
# def course_deleted(sender, instance, **kwargs):
# foruns = Forum.objects.filter(id=instance.forum.id)
# if foruns:
# foruns.delete()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment