def save(self, force_insert=False, force_update=False, commit=True): organizer = super(OrganizerForm, self).save() status = PENDING_STATUS # Automoderate monitor_entry = MonitorEntry.objects.create( content_object=organizer, timestamp=datetime.now() ) monitor_entry.moderate(status, None) # Notify facilitators that this organizer needs moderation mail_moderators('New organizer needs moderation', message_template='organize/notifications/moderate_organizer.txt', borough=organizer.lot.borough, lot=organizer.lot, organizer=organizer, ) return organizer
def save(self, force_insert=False, force_update=False, commit=True): note = super(NoteForm, self).save() user = note.added_by status = PENDING_STATUS if user and user.is_authenticated() and user.is_staff: status = APPROVED_STATUS # Automoderate monitor_entry = MonitorEntry.objects.create( content_object=note, timestamp=datetime.now() ) monitor_entry.moderate(status, user) if status == PENDING_STATUS: # Notify facilitators that this note needs moderation mail_moderators('New note needs moderation', message_template='organize/notifications/moderate_note.txt', borough=note.lot.borough, lot=note.lot, note=note, ) return note