Commit 199288ea by Őry Máté

dashboard: lokalize Notification's subject

parent 7e1d5ab8
...@@ -10,7 +10,7 @@ from django.db.models import ( ...@@ -10,7 +10,7 @@ from django.db.models import (
DateTimeField, DateTimeField,
) )
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _, override from django.utils.translation import ugettext_lazy as _, override, ugettext
from model_utils.models import TimeStampedModel from model_utils.models import TimeStampedModel
from model_utils.fields import StatusField from model_utils.fields import StatusField
...@@ -50,7 +50,7 @@ class Notification(TimeStampedModel): ...@@ -50,7 +50,7 @@ class Notification(TimeStampedModel):
with override(language): with override(language):
context['user'] = user context['user'] = user
rendered = render_to_string(template, context) rendered = render_to_string(template, context)
subject = unicode(subject) subject = ugettext(unicode(subject))
return cls.objects.create(to=user, subject=subject, message=rendered, return cls.objects.create(to=user, subject=subject, message=rendered,
valid_until=valid_until) valid_until=valid_until)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment