Browse Source

Use unicode everywhere

Baptiste Jonglez 10 years ago
parent
commit
c08c29d210

+ 2 - 0
coin/billing/admin.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django import forms
 from django.contrib import admin
 from django.contrib import messages

+ 2 - 0
coin/billing/create_subscriptions_invoices.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import datetime
 from decimal import Decimal
 from dateutil.relativedelta import relativedelta

+ 21 - 19
coin/billing/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import datetime
 import random
 import uuid
@@ -17,21 +19,21 @@ from coin.utils import private_files_storage, start_of_month, end_of_month
 
 def next_invoice_number():
     "Détermine un numéro de facture aléatoire"
-    return u'%s%02i-%i-%i' % (datetime.date.today().year,
+    return '%s%02i-%i-%i' % (datetime.date.today().year,
                               datetime.date.today().month,
                               random.randrange(100, 999),
                               random.randrange(100, 999))
 
 def invoice_pdf_filename(instance, filename):
     "Nom du fichier pdf à stocker pour les factures"
-    return u'invoices/%d_%s_%s.pdf' % (getattr(instance,'member.id',0), instance.number, uuid.uuid4())
+    return 'invoices/%d_%s_%s.pdf' % (getattr(instance,'member.id',0), instance.number, uuid.uuid4())
 
 class Invoice(models.Model):
 
     INVOICES_STATUS_CHOICES = (
-        ('open', u'A payer'),
-        ('closed', u'Reglée'),
-        ('trouble', u'Litige')
+        ('open', 'A payer'),
+        ('closed', 'Reglée'),
+        ('trouble', 'Litige')
     )
 
     validated = models.BooleanField(default=False, verbose_name='Validée')
@@ -46,14 +48,14 @@ class Invoice(models.Model):
     date_due = models.DateField(
         default=end_of_month,
         null=True,
-        verbose_name=u'Date d\'échéance de paiement')
+        verbose_name='Date d\'échéance de paiement')
     member = models.ForeignKey(Member, null=True, blank=True, default=None,
                                related_name='invoices',
                                verbose_name='Membre',
                                on_delete=models.SET_NULL)
     pdf = models.FileField(storage=private_files_storage, upload_to=invoice_pdf_filename,
                            null=True, blank=True,
-                           verbose_name=u'PDF')
+                           verbose_name='PDF')
 
     def amount(self):
         "Calcul le montant de la facture en fonction des éléments de détails"
@@ -88,7 +90,7 @@ class Invoice(models.Model):
     def generate_pdf(self):
         "Make and store a pdf file for the invoice"
         pdf_file = render_as_pdf('billing/invoice_pdf.html', {"invoice": self})
-        self.pdf.save(u'%s.pdf' % self.number, pdf_file)
+        self.pdf.save('%s.pdf' % self.number, pdf_file)
 
     def validate(self):
         """
@@ -104,7 +106,7 @@ class Invoice(models.Model):
         return self.validated and bool(self.pdf) and private_files_storage.exists(self.pdf.name)
 
     def __unicode__(self):
-        return u'#%s %0.2f€ %s' % (self.number, self.amount(), self.date_due)
+        return '#%s %0.2f€ %s' % (self.number, self.amount(), self.date_due)
 
     class Meta:
         verbose_name = 'facture'
@@ -115,7 +117,7 @@ class InvoiceDetail(models.Model):
     label = models.CharField(max_length=100)
     amount = models.DecimalField(max_digits=5, decimal_places=2,
                                  verbose_name='Montant')
-    quantity = models.DecimalField(null=True, verbose_name=u'Quantité',
+    quantity = models.DecimalField(null=True, verbose_name='Quantité',
                                    default=1.0, decimal_places=2, max_digits=4)
     tax = models.DecimalField(null=True, default=0.0, decimal_places=2,
                               max_digits=4, verbose_name='TVA',
@@ -129,14 +131,14 @@ class InvoiceDetail(models.Model):
         default=start_of_month,
         null=True,
         blank=True,
-        verbose_name=u'Début de période',
-        help_text=u'Date de début de période sur laquelle est facturé cet item')
+        verbose_name='Début de période',
+        help_text='Date de début de période sur laquelle est facturé cet item')
     period_to = models.DateField(
         default=end_of_month,
         null=True,
         blank=True,
-        verbose_name=u'Fin de période',
-        help_text=u'Date de fin de période sur laquelle est facturé cet item')
+        verbose_name='Fin de période',
+        help_text='Date de fin de période sur laquelle est facturé cet item')
 
     def __unicode__(self):
         return self.label
@@ -153,10 +155,10 @@ class InvoiceDetail(models.Model):
 class Payment(models.Model):
 
     PAYMENT_MEAN_CHOICES = (
-        ('cash', u'Espèces'),
-        ('check', u'Chèque'),
-        ('transfer', u'Virement'),
-        ('other', u'Autre')
+        ('cash', 'Espèces'),
+        ('check', 'Chèque'),
+        ('transfer', 'Virement'),
+        ('other', 'Autre')
     )
 
     payment_mean = models.CharField(max_length=100, null=True,
@@ -170,7 +172,7 @@ class Payment(models.Model):
                                 related_name='payments')
 
     def __unicode__(self):
-        return u'Paiment de %0.2f€' % self.amount
+        return 'Paiment de %0.2f€' % self.amount
 
     class Meta:
         verbose_name = 'paiement'

+ 2 - 0
coin/billing/tests.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import datetime
 from decimal import Decimal
 from django.test import TestCase, Client

+ 3 - 0
coin/billing/urls.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.conf.urls import patterns, url
 from django.views.generic import DetailView
 from coin.billing import views

+ 3 - 0
coin/billing/utils.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from coin.billing.models import Invoice
 from django.shortcuts import render, get_object_or_404
 

+ 2 - 0
coin/billing/views.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.http import HttpResponse, HttpResponseRedirect
 from django.template import RequestContext
 from django.shortcuts import render, render_to_response

+ 2 - 0
coin/configuration/admin.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin
 

+ 1 - 0
coin/configuration/forms.py

@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
 
 from django.forms import ModelForm, ValidationError
 from django.db.models import Q

+ 2 - 0
coin/configuration/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.db import models
 from polymorphic import PolymorphicModel
 from coin.offers.models import OfferSubscription

+ 3 - 0
coin/configuration/tests.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.test import TestCase
 
 # Create your tests here.

+ 3 - 0
coin/configuration/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.shortcuts import render
 
 # Create your views here.

+ 3 - 0
coin/filtering_queryset.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django import forms
 from django.core.exceptions import ObjectDoesNotExist
 import logging

+ 2 - 0
coin/html2pdf.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import os
 import re
 from xhtml2pdf import pisa

+ 2 - 0
coin/members/admin.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 from django.contrib.auth.admin import UserAdmin
 from django.contrib.auth.models import Group

+ 3 - 0
coin/members/autocomplete_light_registry.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import autocomplete_light
 from models import Member
 

+ 4 - 2
coin/members/forms.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django import forms
 from django.contrib.auth.forms import PasswordResetForm, ReadOnlyPasswordHashField
 
@@ -12,8 +14,8 @@ class MemberCreationForm(forms.ModelForm):
     """
     username = forms.RegexField(required=False,
         label="Nom d'utilisateur", max_length=30, regex=r"^[\w.@+-]+$",
-        help_text=u"Laisser vide pour le générer automatiquement à partir du "
-                  u"nom et du prénom")
+        help_text="Laisser vide pour le générer automatiquement à partir du "
+                  "nom et du prénom")
     password = forms.CharField(required=False, label='Mot de passe', widget=forms.PasswordInput)
 
     class Meta:

+ 2 - 0
coin/members/membershipfee_filter.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib.admin import SimpleListFilter
 import datetime
 

+ 15 - 13
coin/members/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import ldapdb.models
 import unicodedata
 import string
@@ -41,21 +43,21 @@ class Member(CoinLdapSyncMixin, AbstractUser):
                                          verbose_name='Nom de l\'organisme',
                                          help_text='Pour une personne morale')
     home_phone_number = models.CharField(max_length=25, blank=True,
-                                         verbose_name=u'Téléphone fixe')
+                                         verbose_name='Téléphone fixe')
     mobile_phone_number = models.CharField(max_length=25, blank=True,
-                                           verbose_name=u'Téléphone mobile')
+                                           verbose_name='Téléphone mobile')
     # TODO: use a django module that provides an address model? (would
     # support more countries and address types)
-    address = models.TextField(verbose_name=u'adresse', blank=True, null=True)
+    address = models.TextField(verbose_name='adresse', blank=True, null=True)
     postal_code = models.CharField(max_length=5, blank=True, null=True,
                                    validators=[RegexValidator(regex=r'^\d{5}$',
-                                               message=u'Code postal non valide.')],
-                                   verbose_name=u'code postal')
+                                               message='Code postal non valide.')],
+                                   verbose_name='code postal')
     city = models.CharField(max_length=200, blank=True, null=True,
-                            verbose_name=u'Commune')
+                            verbose_name='Commune')
     country = models.CharField(max_length=200, blank=True, null=True,
                                default='France',
-                               verbose_name=u'Pays')
+                               verbose_name='Pays')
     entry_date = models.DateField(null=False,
                                   blank=False,
                                   default=datetime.date.today,
@@ -235,11 +237,11 @@ class CryptoKey(models.Model):
     KEY_TYPE_CHOICES = (('RSA', 'RSA'), ('GPG', 'GPG'))
 
     type = models.CharField(max_length=3, choices=KEY_TYPE_CHOICES)
-    key = models.TextField(verbose_name=u'Clé')
-    member = models.ForeignKey('Member', verbose_name=u'Membre')
+    key = models.TextField(verbose_name='Clé')
+    member = models.ForeignKey('Member', verbose_name='Membre')
 
     def __unicode__(self):
-        return u'Clé %s de %s' % (self.type, self.member)
+        return 'Clé %s de %s' % (self.type, self.member)
 
     class Meta:
         verbose_name = 'clé'
@@ -247,10 +249,10 @@ class CryptoKey(models.Model):
 
 class MembershipFee(models.Model):
     member = models.ForeignKey('Member', related_name='membership_fees',
-                               verbose_name=u'Membre')
+                               verbose_name='Membre')
     #TODO: config: valeur par défaut à externaliser dans la configuration
     amount = models.IntegerField(null=False, default='20', help_text='en €',
-                                 verbose_name=u'Montant')
+                                 verbose_name='Montant')
     start_date = models.DateField(
         null=False,
         blank=False,
@@ -263,7 +265,7 @@ class MembershipFee(models.Model):
         verbose_name='Date de fin de cotisation')
 
     def __unicode__(self):
-        return u'%s - %s - %i€' % (self.member, self.start_date, self.amount)
+        return '%s - %s - %i€' % (self.member, self.start_date, self.amount)
 
     class Meta:
         verbose_name = 'cotisation'

+ 24 - 22
coin/members/tests.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import os
 import datetime
 from django import db
@@ -22,8 +24,8 @@ class MemberTests(TestCase):
         """
 
         #~ Créé un membre
-        first_name = u'Gérard'
-        last_name = u'Majax'
+        first_name = 'Gérard'
+        last_name = 'Majax'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name,
@@ -47,16 +49,16 @@ class MemberTests(TestCase):
         Cela concerne le no met le prénom
         """
         #~ Créé un membre
-        first_name = u'Ronald'
-        last_name = u'Mac Donald'
+        first_name = 'Ronald'
+        last_name = 'Mac Donald'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)
         member.save()
 
         #~  Le modifie
-        new_first_name = u'José'
-        new_last_name = u'Bové'
+        new_first_name = 'José'
+        new_last_name = 'Bové'
         member.first_name = new_first_name
         member.last_name = new_last_name
         member.save()
@@ -103,8 +105,8 @@ class MemberTests(TestCase):
         password = "1234"
 
          #~ Créé un nouveau membre
-        member = Member(first_name=u'Passe-partout',
-                        last_name=u'Du fort Boyard', username=username)
+        member = Member(first_name='Passe-partout',
+                        last_name='Du fort Boyard', username=username)
         member.save()
 
         #~ Récupère l'utilisateur LDAP
@@ -143,8 +145,8 @@ class MemberTests(TestCase):
         Lors de la création d'un membre, le champ "display_name" du LDAP est
         prenom + nom
         """
-        first_name = u'Gérard'
-        last_name = u'Majax'
+        first_name = 'Gérard'
+        last_name = 'Majax'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)
@@ -167,8 +169,8 @@ class MemberTests(TestCase):
         sans caractères accentués et sans espaces.
         """
         random = os.urandom(4).encode('hex')
-        first_name = u'Gérard-Étienne'
-        last_name = u'Majax de la Boétie!B' + random
+        first_name = 'Gérard-Étienne'
+        last_name = 'Majax de la Boétie!B' + random
 
         control = 'gemajaxdelaboetieb' + random
         control = control[:30]
@@ -195,8 +197,8 @@ class MemberTests(TestCase):
                 dbconnection.settings_dict['PASSWORD'] = 'wrong password test'
 
         # Créé un membre
-        first_name = u'Du'
-        last_name = u'Pont'
+        first_name = 'Du'
+        last_name = 'Pont'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)
@@ -221,8 +223,8 @@ class MemberTests(TestCase):
     #     correspondant est mis à jour convenablement
     #     """
     #     # Créé un membre
-    #     first_name = u'Du'
-    #     last_name = u'Pond'
+    #     first_name = 'Du'
+    #     last_name = 'Pond'
     #     password = '1234'
     #     username = MemberTestsUtils.get_random_username()
     #     member = Member(first_name=first_name,
@@ -248,8 +250,8 @@ class MemberTests(TestCase):
         Test que end_date_of_membership d'un membre envoi bien la date de fin d'adhésion
         """
         #Créer un membre
-        first_name = u'Tin'
-        last_name = u'Tin'
+        first_name = 'Tin'
+        last_name = 'Tin'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)
@@ -272,8 +274,8 @@ class MemberTests(TestCase):
         Test que end_date_of_membership d'un membre envoi bien la date de fin d'adhésion
         """
         #Créé un membre
-        first_name = u'Capitain'
-        last_name = u'Haddock'
+        first_name = 'Capitain'
+        last_name = 'Haddock'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)
@@ -331,8 +333,8 @@ class MemberAdminTests(TestCase):
         sur une fiche existante
         """
         #~ Créé un membre
-        first_name = u'Gérard'
-        last_name = u'Majax'
+        first_name = 'Gérard'
+        last_name = 'Majax'
         username = MemberTestsUtils.get_random_username()
         member = Member(first_name=first_name,
                         last_name=last_name, username=username)

+ 3 - 0
coin/members/urls.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.conf.urls import patterns, url
 from django.views.generic import DetailView
 from coin.members import views

+ 3 - 0
coin/members/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.template import RequestContext
 from django.shortcuts import render_to_response
 from django.contrib.auth.decorators import login_required

+ 2 - 0
coin/mixins.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.db import transaction
 
 

+ 2 - 0
coin/offers/admin.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 from polymorphic.admin import PolymorphicChildModelAdmin
 

+ 4 - 2
coin/offers/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import datetime
 
 from django.db import models
@@ -52,7 +54,7 @@ class Offer(models.Model):
         return self.configuration_type
 
     def __unicode__(self):
-        return u'%s : %s - %d€ / %im' % (
+        return '%s : %s - %d€ / %im' % (
             self.get_configuration_type_display(),
             self.name,
             self.period_fees,
@@ -90,7 +92,7 @@ class OfferSubscription(models.Model):
     offer = models.ForeignKey('Offer', verbose_name='Offre')
 
     def __unicode__(self):
-        return u'%s - %s - %s' % (self.member, self.offer.name,
+        return '%s - %s - %s' % (self.member, self.offer.name,
                                        self.subscription_date)
 
     class Meta:

+ 7 - 5
coin/offers/offersubscription_filter.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib.admin import SimpleListFilter
 from django.db.models import Q,F
 import datetime
@@ -10,8 +12,8 @@ class OfferSubscriptionTerminationFilter(SimpleListFilter):
 
     def lookups(self, request, model_admin):
         return (
-            ('not_terminated', u'Abonnements en cours'),
-            ('terminated', u'Abonnements résiliés'),
+            ('not_terminated', 'Abonnements en cours'),
+            ('terminated', 'Abonnements résiliés'),
         )
 
     def queryset(self, request, queryset):
@@ -22,13 +24,13 @@ class OfferSubscriptionTerminationFilter(SimpleListFilter):
 
 
 class OfferSubscriptionCommitmentFilter(SimpleListFilter):
-    title = u'Engagement'
+    title = 'Engagement'
     parameter_name = 'commitment'
 
     def lookups(self, request, model_admin):
         return (
-            ('committed', u'Est engagé'),
-            ('not_committed', u'N\'est plus engagé'),
+            ('committed', 'Est engagé'),
+            ('not_committed', 'N\'est plus engagé'),
         )
 
     def queryset(self, request, queryset):

+ 3 - 0
coin/offers/tests.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.test import TestCase
 
 # Create your tests here.

+ 3 - 0
coin/offers/urls.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.conf.urls import patterns, url
 from coin.offers.views import ConfigurationRedirectView
 

+ 3 - 0
coin/offers/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.views.generic.base import RedirectView
 from django.shortcuts import get_object_or_404
 from django.core.urlresolvers import reverse

+ 3 - 0
coin/resources/admin.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 
 from coin.resources.models import IPPool, IPSubnet

+ 2 - 0
coin/resources/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.db import models
 from django.core.exceptions import ValidationError
 from django.core.validators import MaxValueValidator

+ 3 - 0
coin/resources/tests.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.test import TestCase
 
 # Create your tests here.

+ 3 - 0
coin/resources/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.shortcuts import render
 
 # Create your views here.

+ 3 - 0
coin/reverse_dns/admin.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 
 from coin.reverse_dns.models import NameServer, ReverseDNSEntry

+ 3 - 1
coin/reverse_dns/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.db import models
 from django.core.exceptions import ValidationError
 from django.core.validators import MinValueValidator
@@ -48,4 +50,4 @@ class ReverseDNSEntry(models.Model):
                 raise ValidationError('IP address must be included in the IP subnet.')
 
     def __unicode__(self):
-        return u"{} → {}".format(self.ip, self.reverse)
+        return "{} → {}".format(self.ip, self.reverse)

+ 3 - 0
coin/reverse_dns/tests.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.test import TestCase
 
 # Create your tests here.

+ 3 - 0
coin/reverse_dns/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.shortcuts import render
 
 # Create your views here.

+ 2 - 0
coin/settings.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import os
 import ldap
 

+ 3 - 0
coin/urls.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.conf import settings
 from django.conf.urls import patterns, include, url
 from django.conf.urls.static import static

+ 2 - 0
coin/utils.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import os
 import hashlib
 import binascii

+ 2 - 0
coin/validation.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.core.exceptions import ValidationError
 
 

+ 2 - 0
coin/vpn/admin.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.contrib import admin
 from polymorphic.admin import PolymorphicChildModelAdmin
 

+ 2 - 0
coin/vpn/models.py

@@ -1,4 +1,6 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.db import models
 from django.core.exceptions import ValidationError
 from django.conf import settings

+ 3 - 0
coin/vpn/tests.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.test import TestCase
 
 from coin.offers.models import Offer, OfferSubscription

+ 3 - 0
coin/vpn/urls.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 from django.conf.urls import patterns, url
 from coin.vpn.views import VPNView, VPNGeneratePasswordView, get_graph
 

+ 3 - 0
coin/vpn/views.py

@@ -1,3 +1,6 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
 import os
 from urllib2 import urlopen