def ready(self):
# The app is now ready. Include any monkey patches here.
# Monkey patch CSRF to switch to session based CSRF. Session
# based CSRF will prevent attacks from apps under the same
# domain. If you're planning to host your app under it's own
# domain you can remove session_csrf and use Django's CSRF
# library. See also
# https://github.com/mozilla/sugardough/issues/38
session_csrf.monkeypatch()
# Connect signals.
from atmo.jobs.models import SparkJob
from atmo.jobs.signals import assign_group_perm, remove_group_perm
post_save.connect(
assign_group_perm,
sender=SparkJob,
dispatch_uid='sparkjob_post_save_assign_perm',
)
pre_delete.connect(
remove_group_perm,
sender=SparkJob,
dispatch_uid='sparkjob_pre_delete_remove_perm',
)
评论列表
文章目录