Mercurial > public > sg101
diff messages/forms.py @ 810:4a4fa174a0ec
Private message refactor: adding ability to report PM's.
See also Bitbucket issue #57.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 06 Sep 2014 16:58:08 -0500 |
parents | 0f0ba45704b7 |
children | 999a71b81111 |
line wrap: on
line diff
--- a/messages/forms.py Mon Sep 01 17:05:30 2014 -0500 +++ b/messages/forms.py Sat Sep 06 16:58:08 2014 -0500 @@ -11,8 +11,7 @@ from core.functions import send_mail from core.widgets import AutoCompleteUserInput -from messages.models import Message -from messages.models import Options +from messages.models import Flag, Message, Options from messages import MSG_BOX_LIMIT @@ -124,6 +123,17 @@ fields = ['attach_signature', 'notify_email'] +class ReportForm(forms.ModelForm): + class Meta: + model = Flag + fields = ['comments'] + labels = {'comments': ''} + widgets = { + 'comments': forms.Textarea(attrs={ + 'placeholder': 'Enter a comment for the admin (optional).'}) + } + + def notify_receiver(new_msg): """ This function creates the notification email to notify a user of