Skip to content
Browse files

Merge pull request #10 from emacsway/master

Fixed bug for threaded_messages.views.undelete(), minor improvements
  • Loading branch information...
2 parents 8e79e4a + 05b3fff commit 4ca7dd092759ac09cc82432ddc77a968eeb8e04f @philippWassibauer philippWassibauer committed Mar 24, 2014
View
2 threaded_messages/fields.py
@@ -40,7 +40,7 @@ def clean(self, value):
value = value[0:-1]
names = set(value.split(','))
- names_set = set([name.strip() for name in names])
+ names_set = set([name.strip() for name in names if name.strip()])
users = list(User.objects.filter(username__in=names_set))
unknown_names = names_set ^ set([user.username for user in users])
View
2 threaded_messages/forms.py
@@ -22,7 +22,7 @@ class ComposeForm(forms.Form):
"""
A simple default form for private messages.
"""
- recipient = CommaSeparatedUserField(label=_(u"Recipient"))
+ recipient = CommaSeparatedUserField(label=_(u"Recipients"), help_text=_("Comma separated"))
subject = forms.CharField(label=_(u"Subject"))
body = forms.CharField(label=_(u"Body"),
widget=forms.Textarea(attrs={'rows': '12', 'cols': '55'}))
View
3 threaded_messages/management.py
@@ -1,11 +1,12 @@
from django.conf import settings
+from django.utils.translation import ugettext_noop as _
from django.db.models import signals
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def create_notice_types(app, created_models, verbosity, **kwargs):
- notification.create_notice_type("received_email", "Private messages", "(this is highly recommended)")
+ notification.create_notice_type("received_email", _("Private messages"), _("(this is highly recommended)"))
signals.post_syncdb.connect(create_notice_types, sender=notification)
else:
print "Skipping creation of NoticeTypes (Threaded Messages) as notification app not found"
View
2 threaded_messages/urls.py
@@ -9,7 +9,7 @@
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$', outbox, name='messages_outbox'),
url(r'^compose/$', compose, name='messages_compose'),
- url(r'^compose/(?P<recipient>[\+\w]+)/$', compose, name='messages_compose_to'),
+ url(r'^compose/(?P<recipient>[\w.+-_]+)/$', compose, name='messages_compose_to'),
url(r'^view/(?P<thread_id>[\d]+)/$', view, name='messages_detail'),
url(r'^delete/(?P<thread_id>[\d]+)/$', delete, name='messages_delete'),
url(r'^undelete/(?P<thread_id>[\d]+)/$', undelete, name='messages_undelete'),
View
2 threaded_messages/views.py
@@ -176,7 +176,7 @@ def undelete(request, thread_id, success_url=None):
elif success_url is None:
success_url = reverse('messages_inbox')
- user_part.deleted_at = now()
+ user_part.deleted_at = None
user_part.save()
messages.success(request, _(u"Conversation successfully recovered."))
return HttpResponseRedirect(success_url)

0 comments on commit 4ca7dd0

Please sign in to comment.
Something went wrong with that request. Please try again.