Merge branch 'hotfix/notification_text'

This commit is contained in:
Fergal Moran
2015-09-04 22:18:42 +01:00
3 changed files with 4 additions and 3 deletions

View File

@@ -278,7 +278,7 @@ class NotificationViewSet(viewsets.ModelViewSet):
if not user.is_authenticated():
raise PermissionDenied("Not allowed")
return Notification.objects.filter(to_user=user.userprofile).order_by('-date')
return Notification.objects.filter(to_user=user.userprofile).order_by('-id')
def perform_update(self, serializer):
return super(NotificationViewSet, self).perform_update(serializer)

View File

@@ -29,7 +29,8 @@ class Message(BaseModel):
body = models.TextField()
def create_notification(self, accept=False):
# TODO: Need to keep this away from normal notifications
def __create_notification(self, accept=False):
try:
notification = Notification()
notification.from_user = self.from_user

View File

@@ -39,7 +39,7 @@ class Notification(BaseModel):
'user:message',
self.to_user.get_session_id(),
{
'from_user': self.from_user.slug,
'from_user': self.from_user.slug if self.from_user is not None else settings.DEFAULT_USER_NAME,
'message': self.target_desc
})