Mercurial > public > sg101
comparison messages/forms.py @ 1137:6abcecd3d277
Fix user autocomplete on private messages.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 23 Oct 2016 12:00:04 -0500 |
parents | 82f1f6f905eb |
children | 0e93eaa323e7 |
comparison
equal
deleted
inserted
replaced
1136:ba1df459f3a8 | 1137:6abcecd3d277 |
---|---|
11 | 11 |
12 from core.functions import send_mail | 12 from core.functions import send_mail |
13 from core.html import ImageCheckError | 13 from core.html import ImageCheckError |
14 from core.html import image_check | 14 from core.html import image_check |
15 from core.markup import site_markup | 15 from core.markup import site_markup |
16 from core.widgets import AutoCompleteUserInput | |
17 import messages | 16 import messages |
18 from messages.models import Flag, Message, Options | 17 from messages.models import Flag, Message, Options |
19 | 18 |
20 | 19 |
21 # Maximum size of a private message in characters | 20 # Maximum size of a private message in characters |
26 """ | 25 """ |
27 This form is used to compose private messages. | 26 This form is used to compose private messages. |
28 """ | 27 """ |
29 receiver = forms.CharField(label='To', | 28 receiver = forms.CharField(label='To', |
30 max_length=30, | 29 max_length=30, |
31 widget=AutoCompleteUserInput()) | 30 widget=forms.TextInput(attrs={'class': 'sg101-user-autocomplete'})) |
32 subject = forms.CharField(max_length=120, widget=forms.TextInput(attrs={'size': 52})) | 31 subject = forms.CharField(max_length=120) |
33 message = forms.CharField(widget=forms.Textarea(attrs={'class': 'markItUp smileyTarget'})) | 32 message = forms.CharField(widget=forms.Textarea) |
34 attach_signature = forms.BooleanField(label='Attach Signature?', required=False) | 33 attach_signature = forms.BooleanField(label='Attach Signature?', required=False) |
35 parent_id = forms.IntegerField(required=False, widget=forms.HiddenInput) | 34 parent_id = forms.IntegerField(required=False, widget=forms.HiddenInput) |
36 | 35 |
37 def __init__(self, user, *args, **kwargs): | 36 def __init__(self, user, *args, **kwargs): |
38 forms.Form.__init__(self, *args, **kwargs) | 37 forms.Form.__init__(self, *args, **kwargs) |