def clean()

in moderator/moderate/forms.py [0:0]


    def clean(self):
        """
        Clean method to check post data for nda events,
        and moderated events with no moderators.
        """
        cdata = super(EventForm, self).clean()
        # Do not allow non-nda members to submit NDA events.
        if not self.user.userprofile.is_nda_member and cdata["is_nda"]:
            msg = "Only members of the NDA group can create NDA events."
            raise forms.ValidationError(msg)
        # Don't allow non-superusers to modify moderation status or moderators
        if not cdata["moderators"]:
            msg = "An event should have at least one moderator."
            raise forms.ValidationError(msg)

        return cdata