Unicode fix
This commit is contained in:
parent
1b7a8c33b0
commit
829d91434b
5 changed files with 4 additions and 12 deletions
|
@ -1,7 +1,5 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from autocomplete_light import shortcuts as autocomplete_light
|
from autocomplete_light import shortcuts as autocomplete_light
|
||||||
|
|
||||||
from .models import Obrazek, Galerie
|
from .models import Obrazek, Galerie
|
||||||
|
|
|
@ -3,7 +3,6 @@ import os
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
from django.core.exceptions import ObjectDoesNotExist
|
from django.core.exceptions import ObjectDoesNotExist
|
||||||
from django.utils.text import get_valid_filename
|
from django.utils.text import get_valid_filename
|
||||||
|
@ -29,7 +28,6 @@ def generate_filename(self, filename):
|
||||||
|
|
||||||
|
|
||||||
#@reversion.register(ignore_duplicates=True)
|
#@reversion.register(ignore_duplicates=True)
|
||||||
#@python_2_unicode_compatible
|
|
||||||
class KorekturovanePDF(models.Model):
|
class KorekturovanePDF(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
ordering = ['-cas']
|
ordering = ['-cas']
|
||||||
|
@ -112,7 +110,6 @@ class KorekturovanePDF(models.Model):
|
||||||
self.convert()
|
self.convert()
|
||||||
|
|
||||||
@reversion.register(ignore_duplicates=True)
|
@reversion.register(ignore_duplicates=True)
|
||||||
@python_2_unicode_compatible
|
|
||||||
class Oprava(models.Model):
|
class Oprava(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'opravy'
|
db_table = 'opravy'
|
||||||
|
@ -159,7 +156,6 @@ class Oprava(models.Model):
|
||||||
|
|
||||||
|
|
||||||
@reversion.register(ignore_duplicates=True)
|
@reversion.register(ignore_duplicates=True)
|
||||||
@python_2_unicode_compatible
|
|
||||||
class Komentar(models.Model):
|
class Komentar(models.Model):
|
||||||
class Meta:
|
class Meta:
|
||||||
db_table = 'komentare'
|
db_table = 'komentare'
|
||||||
|
|
|
@ -13,7 +13,6 @@ from .forms import OpravaForm
|
||||||
import subprocess
|
import subprocess
|
||||||
import shutil
|
import shutil
|
||||||
import os
|
import os
|
||||||
import unicodedata
|
|
||||||
|
|
||||||
class KorekturyHelpView(generic.TemplateView):
|
class KorekturyHelpView(generic.TemplateView):
|
||||||
template_name = 'korektury/help.html'
|
template_name = 'korektury/help.html'
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
|
||||||
from django.utils.encoding import force_text
|
from django.utils.encoding import force_text
|
||||||
|
|
||||||
from seminar.models import Organizator, Soustredeni
|
from seminar.models import Organizator, Soustredeni
|
||||||
|
|
|
@ -19,7 +19,7 @@ def merge_props(r1, r2, prop, pretend=True, smaller=False, equal=True):
|
||||||
r1.__setattr__(prop, a2)
|
r1.__setattr__(prop, a2)
|
||||||
elif a2:
|
elif a2:
|
||||||
if equal and a1 != a2:
|
if equal and a1 != a2:
|
||||||
log.warn(u"merge: Ruzna %s: %s VS %s", prop, a1, a2)
|
log.warn("merge: Ruzna %s: %s VS %s", prop, a1, a2)
|
||||||
if smaller:
|
if smaller:
|
||||||
if not pretend:
|
if not pretend:
|
||||||
r1.__setattr__(prop, min(a1, a2))
|
r1.__setattr__(prop, min(a1, a2))
|
||||||
|
@ -33,16 +33,16 @@ def merge_Resitel(rbase, rmerge, pretend=True):
|
||||||
# Ma relace: skola
|
# Ma relace: skola
|
||||||
# Je v relaci: user, reseni, soustredeni_ucastnici, vysledky_base(VIEW)
|
# Je v relaci: user, reseni, soustredeni_ucastnici, vysledky_base(VIEW)
|
||||||
|
|
||||||
log.info(u"merge: %s <- %s", unicode(rbase), unicode(rmerge))
|
log.info("merge: %s <- %s", unicode(rbase), unicode(rmerge))
|
||||||
|
|
||||||
assert not rbase.user
|
assert not rbase.user
|
||||||
assert not rmerge.user
|
assert not rmerge.user
|
||||||
assert rbase != rmerge
|
assert rbase != rmerge
|
||||||
|
|
||||||
if (rbase.jmeno != rmerge.jmeno) or (rbase.prijmeni != rmerge.prijmeni):
|
if (rbase.jmeno != rmerge.jmeno) or (rbase.prijmeni != rmerge.prijmeni):
|
||||||
log.error(u"merge: Ruzna jmena: %s VS %s", rbase, rmerge)
|
log.error("merge: Ruzna jmena: %s VS %s", rbase, rmerge)
|
||||||
if rbase.rok_maturity != rmerge.rok_maturity:
|
if rbase.rok_maturity != rmerge.rok_maturity:
|
||||||
log.error(u"merge: Ruzne roky maturity: %s VS %s", rbase.rok_maturity, rmerge.rok_maturity)
|
log.error("merge: Ruzne roky maturity: %s VS %s", rbase.rok_maturity, rmerge.rok_maturity)
|
||||||
|
|
||||||
with reversion.create_revision():
|
with reversion.create_revision():
|
||||||
reversion.set_comment('Merge duplicitnich Resitelu: %r <- %r' % (rbase.pk, rmerge.pk))
|
reversion.set_comment('Merge duplicitnich Resitelu: %r <- %r' % (rbase.pk, rmerge.pk))
|
||||||
|
|
Loading…
Reference in a new issue