def post_create_comm_note(note): """Stuff to do after creating note, also used in comm api's post_save.""" from mkt.reviewers.utils import send_note_emails thread = note.thread app = thread.addon # CC mozilla contact. for email in app.get_mozilla_contacts(): try: moz_contact = UserProfile.objects.get(email=email) thread.thread_cc.get_or_create(user=moz_contact) except UserProfile.DoesNotExist: pass # CC note author, mark their own note as read. author = note.author cc, created_cc = thread.thread_cc.get_or_create(user=author) if not created_cc: note.mark_read(note.author) # Email. send_note_emails(note)
def post_save(self, obj, created=False): if created: send_note_emails(obj)