def send(self, rdata, user): if not user.is_authenticated(): return {'error': _('You should be authenticated.')} form = SendMessageForm(user, rdata) if form.is_valid(): form.save() else: return dict(errors=form.get_errors()) return {}
def send(self, rdata, user): if not user.is_authenticated(): return {'error': _('You should be authenticated.')} form = SendMessageForm(user, rdata) if form.is_valid(): m = form.save() send_new_message_notification.delay(m.pk) else: return dict(errors=form.get_errors()) return {}