X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e3d6e94589c1356d3f8d1b7fc36d9f21d966e16a..94b8b2f9bdaa5d2c42abfab87297aa690b572123:/apps/catalogue/models/document.py diff --git a/apps/catalogue/models/document.py b/apps/catalogue/models/document.py index 6d9cb732..21eb7774 100755 --- a/apps/catalogue/models/document.py +++ b/apps/catalogue/models/document.py @@ -10,6 +10,7 @@ from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import models from django.template.loader import render_to_string +from django.utils.encoding import force_unicode from django.utils.translation import ugettext_lazy as _ from dvcs.models import Ref from organizations.models import Organization @@ -86,6 +87,9 @@ class Document(Ref): self.assigned_to = None self.save() + def stage_name(self): + return force_unicode(dict(STAGES)[self.stage]) if self.stage else None + def get_plan(self): try: plan = self.plan_set.get(stage=self.stage)