From f744e2e9471e21b143481f92f9726e728c378d15 Mon Sep 17 00:00:00 2001 From: Maxime Haineault Date: Tue, 7 May 2013 11:36:53 -0400 Subject: [PATCH] Fixed i18n bug with lazy, worked on google analytic code extraction --- seoutils/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/seoutils/models.py b/seoutils/models.py index ea30a9c..a373c09 100644 --- a/seoutils/models.py +++ b/seoutils/models.py @@ -3,7 +3,7 @@ import re from django.db import models -from django.utils.translation import gettext_lazy as _ +from django.utils.translation import gettext as _ CONTENT_TYPE_CHOICES = ( ('text/plain', _('Plain text')), @@ -48,11 +48,12 @@ class Analytic(models.Model): is_active = models.BooleanField(_('Is active'), default=True) def __unicode__(self): - regex = re.compile("('UA-.*')") + regex = re.compile("""(['"]UA-.*['"])""") try: - return regex.findall(self.code)[0].replace("'", '') + return regex.findall(self.code)[0].replace("'", '').replace('"', '') except: return _('Unknown analytic code') + return _('Unknown analytic code') class VirtualFile(models.Model):