diff options
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/admin.py | 2 | ||||
-rw-r--r-- | ishtar_common/forms.py | 6 | ||||
-rw-r--r-- | ishtar_common/forms_common.py | 2 | ||||
-rw-r--r-- | ishtar_common/models_imports.py | 6 | ||||
-rw-r--r-- | ishtar_common/tests.py | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py index cccc1f889..2fe0c012a 100644 --- a/ishtar_common/admin.py +++ b/ishtar_common/admin.py @@ -1149,7 +1149,7 @@ class ProfileTypeSummaryAdmin(admin.ModelAdmin): groups = [] ok = mark_safe( - u'<img src="{}admin/img/icon-yes.svg" alt="True">'.format( + '<img src="{}admin/img/icon-yes.svg" alt="True">'.format( settings.STATIC_URL )) for group in models.Group.objects.order_by("name"): diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 74590c240..5b6501b13 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -89,7 +89,7 @@ def file_size_validator(value): limit = (settings.MAX_UPLOAD_SIZE * 1024 * 1024) - 100 if value.size > limit: raise ValidationError( - str(_(u'File too large. Size should not exceed {} Mo.')).format( + str(_('File too large. Size should not exceed {} Mo.')).format( settings.MAX_UPLOAD_SIZE ) ) @@ -448,7 +448,7 @@ class MultiSearchForm(CustomFormSearch): if not data or cls.pk_key not in data or not data[cls.pk_key]: continue pks = data[cls.pk_key] - for pk in str(pks).split(u','): + for pk in str(pks).split(','): if not pk: continue try: @@ -1000,7 +1000,7 @@ def get_form_selection( def get_data_from_formset(data): """ - convert ['formname-wizardname-1-public_domain': [u'on'], ...] to + convert ['formname-wizardname-1-public_domain': ['on'], ...] to [{'public_domain': 'off'}, {'public_domain': 'on'}] """ values = [] diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 7224620e0..22a9e0279 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -97,7 +97,7 @@ def get_person_field(label=_("Person"), required=True, person_types=[]): person_types = [ str(models.PersonType.objects.get(txt_idx=person_type).pk) for person_type in person_types] - url += "/" + u'_'.join(person_types) + url += "/" + '_'.join(person_types) widget = widgets.JQueryAutoComplete(url, associated_model=models.Person) return forms.IntegerField(widget=widget, label=label, required=required, validators=[models.valid_id(models.Person)]) diff --git a/ishtar_common/models_imports.py b/ishtar_common/models_imports.py index b3b64bd65..7a8a10bc2 100644 --- a/ishtar_common/models_imports.py +++ b/ishtar_common/models_imports.py @@ -947,7 +947,7 @@ class Import(models.Model): "will be used.") ) encoding = models.CharField(_("Encoding"), choices=ENCODINGS, - default=u'utf-8', max_length=15) + default='utf-8', max_length=15) csv_sep = models.CharField( _("CSV separator"), choices=CSV_SEPS, default=',', max_length=1, help_text=_("Separator for CSV file. Standard is comma but Microsoft " @@ -966,10 +966,10 @@ class Import(models.Model): _("Match file"), upload_to="upload/imports/%Y/%m/", blank=True, null=True, max_length=255, help_text=max_size_help()) state = models.CharField(_("State"), max_length=2, choices=IMPORT_STATE, - default=u'C') + default='C') conservative_import = models.BooleanField( _("Conservative import"), default=False, - help_text=_(u'If set to true, do not overload existing values.')) + help_text=_('If set to true, do not overload existing values.')) creation_date = models.DateTimeField( _("Creation date"), auto_now_add=True, blank=True, null=True) end_date = models.DateTimeField(_("End date"), auto_now_add=True, diff --git a/ishtar_common/tests.py b/ishtar_common/tests.py index 4356509e8..d6802ef77 100644 --- a/ishtar_common/tests.py +++ b/ishtar_common/tests.py @@ -2391,7 +2391,7 @@ class IshtarSiteProfileTest(TestCase): def testExternalKey(self): profile = models.get_current_profile() - p = models.Person.objects.create(name='plouf', surname=u'Tégada') + p = models.Person.objects.create(name='plouf', surname='Tégada') self.assertEqual(p.raw_name, "PLOUF Tégada") profile.person_raw_name = '{surname|slug} {name}' profile.save() |