diff options
28 files changed, 86 insertions, 63 deletions
diff --git a/archaeological_context_records/models.py b/archaeological_context_records/models.py index df6d22ff2..ff33d8bf3 100644 --- a/archaeological_context_records/models.py +++ b/archaeological_context_records/models.py @@ -774,7 +774,6 @@ class ContextRecord( verbose_name = _("Context Record") verbose_name_plural = _("Context Record") permissions = ( - ("view_contextrecord", "Can view all Context Records"), ("view_own_contextrecord", "Can view own Context Record"), ("add_own_contextrecord", "Can add own Context Record"), ("change_own_contextrecord", "Can change own Context Record"), diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index defb7ba05..450eadd74 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -331,7 +331,7 @@ class FileFormGeneralRO(FileFormGeneral): numeric_reference = forms.IntegerField( label=_("Numeric reference"), widget=forms.TextInput() ) - id = forms.IntegerField(" ", widget=forms.HiddenInput, required=False) + id = forms.IntegerField(label=" ", widget=forms.HiddenInput, required=False) def clean(self): cleaned_data = self.cleaned_data diff --git a/archaeological_files/models.py b/archaeological_files/models.py index 3a6c2d8c5..6ea53c731 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -747,7 +747,6 @@ class File( verbose_name = _("Archaeological file") verbose_name_plural = _("Archaeological files") permissions = ( - ("view_file", "Can view all Archaeological files"), ("view_own_file", "Can view own Archaeological file"), ("add_own_file", "Can add own Archaeological file"), ("change_own_file", "Can change own Archaeological file"), diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 63afb9dff..2218cb011 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -470,7 +470,6 @@ class BaseFind( verbose_name = _("Base find") verbose_name_plural = _("Base finds") permissions = ( - ("view_basefind", "Can view all Base finds"), ("view_own_basefind", "Can view own Base find"), ("add_own_basefind", "Can add own Base find"), ("change_own_basefind", "Can change own Base find"), @@ -2010,7 +2009,6 @@ class Find( verbose_name = _("Find") verbose_name_plural = _("Finds") permissions = ( - ("view_find", "Can view all Finds"), ("view_own_find", "Can view own Find"), ("add_own_find", "Can add own Find"), ("change_own_find", "Can change own Find"), diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py index 7cbf0334a..d52516ff2 100644 --- a/archaeological_finds/models_treatments.py +++ b/archaeological_finds/models_treatments.py @@ -289,7 +289,6 @@ class Treatment( verbose_name_plural = _("Treatments") unique_together = ("year", "index") permissions = ( - ("view_treatment", "Can view all Treatments"), ("view_own_treatment", "Can view own Treatment"), ("add_own_treatment", "Can add own Treatment"), ("change_own_treatment", "Can change own Treatment"), @@ -1176,7 +1175,6 @@ class TreatmentFile( verbose_name_plural = _("Treatment requests") unique_together = ("year", "index") permissions = ( - ("view_treatmentfile", "Can view all Treatment requests"), ("view_own_treatmentfile", "Can view own Treatment request"), ("add_own_treatmentfile", "Can add own Treatment request"), ("change_own_treatmentfile", "Can change own Treatment request"), diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 568917c97..050e50240 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -441,7 +441,6 @@ class ArchaeologicalSite( verbose_name = _("Archaeological site") verbose_name_plural = _("Archaeological sites") permissions = ( - ("view_archaeologicalsite", "Can view all Archaeological sites"), ("view_own_archaeologicalsite", "Can view own Archaeological site"), ("add_own_archaeologicalsite", "Can add own Archaeological site"), ("change_own_archaeologicalsite", "Can change own Archaeological site"), @@ -1368,7 +1367,6 @@ class Operation( verbose_name = _("Operation") verbose_name_plural = _("Operations") permissions = ( - ("view_operation", "Can view all Operations"), ("view_own_operation", "Can view own Operation"), ("add_own_operation", "Can add own Operation"), ("change_own_operation", "Can change own Operation"), @@ -2584,7 +2582,6 @@ class AdministrativeAct(DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter) verbose_name = _("Administrative act") verbose_name_plural = _("Administrative acts") permissions = ( - ("view_administrativeact", "Can view all Administrative acts"), ("view_own_administrativeact", "Can view own Administrative act"), ("add_own_administrativeact", "Can add own Administrative act"), ("change_own_administrativeact", "Can change own Administrative act"), diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index ccc16d206..2ea825406 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -399,7 +399,6 @@ class Warehouse( verbose_name = _("Warehouse") verbose_name_plural = _("Warehouses") permissions = ( - ("view_warehouse", "Can view all Warehouses"), ("view_own_warehouse", "Can view own Warehouse"), ("add_own_warehouse", "Can add own Warehouse"), ("change_own_warehouse", "Can change own Warehouse"), @@ -1116,7 +1115,6 @@ class Container( ) unique_together = [("location", "container_type", "parent", "reference")] permissions = ( - ("view_container", "Can view all Containers"), ("view_own_container", "Can view own Container"), ("add_own_container", "Can add own Container"), ("change_own_container", "Can change own Container"), diff --git a/bootstrap_datepicker/widgets.py b/bootstrap_datepicker/widgets.py index 338319311..5a4a1e874 100644 --- a/bootstrap_datepicker/widgets.py +++ b/bootstrap_datepicker/widgets.py @@ -52,7 +52,7 @@ class DatePicker(DateTimeInput): yield 'js/locales/bootstrap-datepicker.%s.min.js' % ( lang) - js = JSFiles() + js = list(JSFiles()) css = {'all': ('css/bootstrap-datepicker3.standalone.min.css',), } # http://bootstrap-datepicker.readthedocs.org/en/stable/options.html#format # http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior @@ -134,7 +134,7 @@ class DatePicker(DateTimeInput): value = value.strftime(py_format) return value - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): if value is None: value = '' extra_attrs = dict() diff --git a/example_project/urls.py b/example_project/urls.py index 8ccc28815..5eff7a9c4 100644 --- a/example_project/urls.py +++ b/example_project/urls.py @@ -6,14 +6,11 @@ from ishtar_common.apps import admin_site from ajax_select import urls as ajax_select_urls from ishtar_common.views import index +from ishtar_common.urls_registration import urlpatterns admin.autodiscover() - -urlpatterns = [ - url(r'^accounts/', include('django_registration.urls')), - -] +urlpatterns = urlpatterns[:] APP_LIST = ['archaeological_files_pdl', 'archaeological_files', 'archaeological_operations', 'archaeological_context_records', @@ -24,7 +21,7 @@ for app in APP_LIST: ] urlpatterns += [ - url(r'^admin/', include(admin_site.urls)), + url(r'^admin/', include(admin_site.urls[:2])), url(r'^ajax-select/', include(ajax_select_urls)), url(r'', include('ishtar_common.urls')), url(r'^$', index, name='start'), diff --git a/ishtar_common/admin.py b/ishtar_common/admin.py index 752594616..69f8ec92c 100644 --- a/ishtar_common/admin.py +++ b/ishtar_common/admin.py @@ -61,7 +61,8 @@ from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts import render from django.urls import reverse from django.utils.decorators import method_decorator -from django.utils.text import slugify, mark_safe +from django.utils.text import slugify +from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.views.decorators.csrf import csrf_protect @@ -105,7 +106,7 @@ ISHTAR_FORMS = [ class ImportGenericForm(forms.Form): csv_file = forms.FileField( - _("CSV file"), + label=_("CSV file"), help_text=_("Only unicode encoding is managed - convert your" " file first"), ) @@ -709,7 +710,7 @@ class ImportActionAdmin(admin.ModelAdmin): class ImportGeoJsonForm(forms.Form): json_file = forms.FileField( - _("Geojson file"), + label=_("Geojson file"), help_text=_( "Only unicode encoding is managed - convert your" " file first. The file must be a geojson file or a zip " @@ -936,7 +937,7 @@ class ImportGEOJSONActionAdmin(object): class ImportJSONForm(forms.Form): json_file = forms.FileField( - _("Zipped JSON file"), + label=_("Zipped JSON file"), help_text=_("Import from a zipped JSON file generated by Ishtar"), ) diff --git a/ishtar_common/backend.py b/ishtar_common/backend.py index e3d53c80e..00f90f444 100644 --- a/ishtar_common/backend.py +++ b/ishtar_common/backend.py @@ -33,7 +33,7 @@ class ObjectPermBackend(ModelBackend): supports_anonymous_user = True def has_perm(self, user_obj, perm, model=None, obj=None, session=None): - if not user_obj.is_authenticated(): + if not user_obj.is_authenticated: return False if not model: # let it manage by the default backend diff --git a/ishtar_common/management/commands/media_clean_unused.py b/ishtar_common/management/commands/media_clean_unused.py index 33237c1c7..f09cc9e9a 100644 --- a/ishtar_common/management/commands/media_clean_unused.py +++ b/ishtar_common/management/commands/media_clean_unused.py @@ -7,7 +7,6 @@ https://github.com/akolpakov/django-unused-media import os -import six.moves from django.conf import settings from django.core.management.base import BaseCommand @@ -89,7 +88,7 @@ class Command(BaseCommand): # ask user question = 'Are you sure you want to remove {} unused files? (y/N)'.format(len(unused_media)) - if six.moves.input(question).upper() != 'Y': + if input(question).upper() != 'Y': self.info('Interrupted by user. Exit.') return diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 6196e1efe..b4d6eb0f2 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1756,7 +1756,7 @@ class UserDashboard: class StatsCache(models.Model): model = models.CharField(_("Model name"), max_length=200) model_pk = models.IntegerField(_("Associated primary key")) - values = JSONField(default={}, blank=True) + values = JSONField(default=dict, blank=True) updated = models.DateTimeField(default=datetime.datetime.now) update_requested = models.DateTimeField(blank=True, null=True) @@ -2407,7 +2407,6 @@ class Organization(Address, Merge, OwnPerms, BaseGenderedType, ValueGetter, Main verbose_name = _("Organization") verbose_name_plural = _("Organizations") permissions = ( - ("view_organization", "Can view all Organizations"), ("view_own_organization", "Can view own Organization"), ("add_own_organization", "Can add own Organization"), ("change_own_organization", "Can change own Organization"), @@ -2697,7 +2696,6 @@ class Person(Address, Merge, OwnPerms, ValueGetter, MainItem): GinIndex(fields=["data"]), ] permissions = ( - ("view_person", "Can view all Persons"), ("view_own_person", "Can view own Person"), ("add_own_person", "Can add own Person"), ("change_own_person", "Can change own Person"), @@ -3401,7 +3399,6 @@ class Author(FullSearch): verbose_name_plural = _("Authors") ordering = ("author_type__order", "person__name") permissions = ( - ("view_author", "Can view all Authors"), ("view_own_author", "Can view own Author"), ("add_own_author", "Can add own Author"), ("change_own_author", "Can change own Author"), @@ -4045,7 +4042,6 @@ class Document( verbose_name_plural = _("Documents") ordering = ("title",) permissions = ( - ("view_document", ugettext("Can view all Documents")), ("view_own_document", ugettext("Can view own Document")), ("add_own_document", ugettext("Can add own Document")), ("change_own_document", ugettext("Can change own Document")), diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 6b137f2fd..66cf0c5e5 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -31,7 +31,7 @@ from django.core.cache import cache from django.core.exceptions import ObjectDoesNotExist from django.core.files import File from django.core.serializers import serialize -from django.urls import reverse +from django.urls import reverse, NoReverseMatch from django.core.validators import validate_slug from django.db import connection from django.db.models import Q, Count, Max @@ -1002,7 +1002,7 @@ class Imported(models.Model): class JsonData(models.Model, CachedGen): - data = JSONField(default={}, blank=True) + data = JSONField(default=dict, blank=True) class Meta: abstract = True @@ -1320,7 +1320,7 @@ class BaseHistorizedItem( null=True, ) last_modified = models.DateTimeField(blank=True, default=datetime.datetime.now) - history_m2m = JSONField(default={}, blank=True) + history_m2m = JSONField(default=dict, blank=True) need_update = models.BooleanField(verbose_name=_("Need update"), default=False) locked = models.BooleanField( verbose_name=_("Item locked for edition"), default=False @@ -1727,7 +1727,7 @@ class OwnPerms(object): """ if not replace_query: replace_query = {} - if hasattr(user, "is_authenticated") and not user.is_authenticated(): + if hasattr(user, "is_authenticated") and not user.is_authenticated: returned = cls.objects.filter(pk__isnull=True) if values: returned = [] diff --git a/ishtar_common/templates/account_activation_email.txt b/ishtar_common/templates/account_activation_email.txt index 7498a86c7..fbd90ad58 100644 --- a/ishtar_common/templates/account_activation_email.txt +++ b/ishtar_common/templates/account_activation_email.txt @@ -5,7 +5,7 @@ * {% trans "Login:" %} {{login}} * {% trans "Password:" %} {{password}} -{% trans "You can log in here:" %} {{scheme}}://{{site}}{% url "auth_login" %} +{% trans "You can log in here:" %} {{scheme}}://{{site}}{% url "login" %} {% trans "Thank you for you interest in the project." %} diff --git a/ishtar_common/templates/navbar.html b/ishtar_common/templates/navbar.html index bc244973c..d8e368bbc 100644 --- a/ishtar_common/templates/navbar.html +++ b/ishtar_common/templates/navbar.html @@ -30,17 +30,17 @@ <a class="dropdown-item" href="{% url 'profile' %}"> {% trans "Profile" %} </a> - <a class="dropdown-item" href="{% url 'auth_password_change' %}"> + <a class="dropdown-item" href="{% url 'password_change' %}"> {% trans "Change password" %} </a> - <a class="dropdown-item" href="{% url 'auth_logout' %}"> + <a class="dropdown-item" href="{% url 'logout' %}"> {% trans "Log out" %} </a> </div> </li> {% else %} <li class="nav-item"> - <a class="nav-link" href="{% url 'auth_login' %}">{% trans "Log in" %}</a> + <a class="nav-link" href="{% url 'login' %}">{% trans "Log in" %}</a> </li> {% endif %} {% if LANGUAGES|length > 1 %} diff --git a/ishtar_common/templates/registration/activate.html b/ishtar_common/templates/registration/activate.html index 0dcbccc00..261b38b1f 100644 --- a/ishtar_common/templates/registration/activate.html +++ b/ishtar_common/templates/registration/activate.html @@ -7,7 +7,7 @@ <p>{% trans "Account successfully activated" %}</p> -<p><a href="{% url auth_login %}">{% trans "Log in" %}</a></p> +<p><a href="{% url 'login' %}">{% trans "Log in" %}</a></p> {% else %} diff --git a/ishtar_common/templates/registration/activation_complete.html b/ishtar_common/templates/registration/activation_complete.html index 7db8c186e..dbe6c15ed 100644 --- a/ishtar_common/templates/registration/activation_complete.html +++ b/ishtar_common/templates/registration/activation_complete.html @@ -5,7 +5,7 @@ <div class='info'> <p>{% trans "You may now login with your username and password." %}</p> {% if not user.is_authenticated %} -<a href="{% url "auth_login" %}">{% trans "Login now" %}</a> +<a href="{% url 'login' %}">{% trans "Login now" %}</a> {% else %} <a href="/">{% trans "Home" %}</a> {% endif %} diff --git a/ishtar_common/templates/registration/login.html b/ishtar_common/templates/registration/login.html index 4d8e2f37b..452ef91ef 100644 --- a/ishtar_common/templates/registration/login.html +++ b/ishtar_common/templates/registration/login.html @@ -35,7 +35,7 @@ <hr/> <div class="row justify-content-center"> <div class="col-md-6"> - <small class="text-secondary">{% trans "Forgot password?" %} <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a> – + <small class="text-secondary">{% trans "Forgot password?" %} <a href="{% url 'password_reset' %}">{% trans "Reset it" %}</a> – {% trans "Not member?" %} <a href="{% url 'registration_register' %}">{% trans "Register" %}</a></small> </div> </div> diff --git a/ishtar_common/templates/registration/password_reset_complete.html b/ishtar_common/templates/registration/password_reset_complete.html index dfa3ce682..053270f78 100644 --- a/ishtar_common/templates/registration/password_reset_complete.html +++ b/ishtar_common/templates/registration/password_reset_complete.html @@ -5,6 +5,6 @@ <div class='info'> <p>{% trans "Password reset successfully" %}</p> -<p><a href="{% url auth_login %}">{% trans "Log in" %}</a></p> +<p><a href="{% url 'login' %}">{% trans "Log in" %}</a></p> </div> {% endblock %} diff --git a/ishtar_common/templates/registration/password_reset_email.html b/ishtar_common/templates/registration/password_reset_email.html index a55c86958..05612cf58 100644 --- a/ishtar_common/templates/registration/password_reset_email.html +++ b/ishtar_common/templates/registration/password_reset_email.html @@ -1,5 +1,5 @@ {% load i18n %} {% blocktrans %}Reset password at {{ site_name }}{% endblocktrans %}: {% block reset_link %} -{{ protocol }}://{{ domain }}{% url auth_password_reset_confirm uidb36=uid, token=token %} +{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb36=uid, token=token %} {% endblock %} diff --git a/ishtar_common/templatetags/ishtar_helpers.py b/ishtar_common/templatetags/ishtar_helpers.py index 375f80ae7..ade89bdc0 100644 --- a/ishtar_common/templatetags/ishtar_helpers.py +++ b/ishtar_common/templatetags/ishtar_helpers.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from django.template import Library -from django.utils.text import mark_safe +from django.utils.safestring import mark_safe register = Library() diff --git a/ishtar_common/templatetags/window_field.py b/ishtar_common/templatetags/window_field.py index 0a1914556..0e6b4e0d6 100644 --- a/ishtar_common/templatetags/window_field.py +++ b/ishtar_common/templatetags/window_field.py @@ -3,7 +3,7 @@ import os from django import template from django.template import loader from django.utils.translation import ugettext as _ -from django.utils.text import mark_safe +from django.utils.safestring import mark_safe from ishtar_common.templatetags.link_to_window import link_to_window diff --git a/ishtar_common/urls_registration.py b/ishtar_common/urls_registration.py new file mode 100644 index 000000000..4b9e85289 --- /dev/null +++ b/ishtar_common/urls_registration.py @@ -0,0 +1,34 @@ +from django.conf.urls import include, url +from django.views.generic.base import TemplateView + +from django_registration import views + + +urlpatterns = [ + url(r'^accounts/activate/complete/$', + TemplateView.as_view( + template_name='registration/activation_complete.html' + ), + name='registration_activation_complete'), + # Activation keys get matched by \w+ instead of the more specific + # [a-fA-F0-9]{40} because a bad activation key should still get to + # the view; that way it can return a sensible "invalid key" + # message instead of a confusing 404. + url(r'^accounts/activate/(?P<activation_key>\w+)/$', + views.ActivationView.as_view(), + name='registration_activate'), + url(r'^accounts/register/$', + views.RegistrationView.as_view(), + name='registration_register'), + url(r'^accounts/register/complete/$', + TemplateView.as_view( + template_name='registration/registration_complete.html' + ), + name='registration_complete'), + url(r'^accounts/register/closed/$', + TemplateView.as_view( + template_name='registration/registration_closed.html' + ), + name='registration_disallowed'), + url("^accounts/", include('django.contrib.auth.urls')), +]
\ No newline at end of file diff --git a/ishtar_common/utils.py b/ishtar_common/utils.py index cbf4242b2..3a349c04b 100644 --- a/ishtar_common/utils.py +++ b/ishtar_common/utils.py @@ -33,7 +33,6 @@ import re import requests from secretary import Renderer as MainSecretaryRenderer, UndefinedSilently import shutil -import six import subprocess import sys import tempfile @@ -227,7 +226,7 @@ def check_model_access_control(request, model, available_perms=None): """ own = True # more restrictive by default allowed = False - if not request.user.is_authenticated(): + if not request.user.is_authenticated: return allowed, own if not available_perms: @@ -1797,7 +1796,7 @@ def get_all_media(exclude=None, debug=False): exclude = [] media = set() - full_dirs = list(os.walk(six.text_type(settings.MEDIA_ROOT))) + full_dirs = list(os.walk(settings.MEDIA_ROOT)) ln_full = len(full_dirs) for idx_main, full_dir in enumerate(full_dirs): root, dirs, files = full_dir diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 24ef044bb..81e6d5e05 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -44,7 +44,7 @@ from django.http import ( JsonResponse, ) from django.shortcuts import redirect, render, get_object_or_404 -from django.urls import reverse +from django.urls import reverse, NoReverseMatch from django.utils.decorators import method_decorator from django.utils.translation import ugettext, ugettext_lazy as _ from django.views.generic import ListView, TemplateView, View diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index bab6b3e00..e444261d9 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -71,11 +71,11 @@ class SelectReadonly(forms.Select): label = str(i) yield (i.pk, label) - def render(self, name, value, attrs=None, choices=()): + def render(self, name, value, attrs=None, choices=(), renderer=None): if value: self.choices = list(self.get_choices(value)) value = self.choices[0][0] - return super(SelectReadonly, self).render(name, value, attrs) + return super(SelectReadonly, self).render(name, value, attrs, renderer=None) class SelectReadonlyField(forms.ChoiceField): @@ -98,7 +98,14 @@ class SelectReadonlyField(forms.ChoiceField): self.available = kwargs.pop("available") widget = SelectReadonly(model=self.model, available=self.available) super(SelectReadonlyField, self).__init__( - choices, required, widget, label, initial, help_text, *args, **kwargs + choices=choices, + required=required, + widget=widget, + label=label, + initial=initial, + help_text=help_text, + *args, + **kwargs ) def get_q(self): @@ -132,7 +139,7 @@ class Select2DynamicBase(Select2Media): """ MULTIPLE = False - def render(self, name, value, attrs=None, choices=()): + def render(self, name, value, attrs=None, choices=(), renderer=None): choices = choices or getattr(self, "choices", []) if value: values = [value] @@ -170,7 +177,7 @@ class Select2DynamicBase(Select2Media): if self.MULTIPLE: options.append("multiple: 'true'") - html = super(Select2DynamicBase, self).render(name, value, attrs) + html = super(Select2DynamicBase, self).render(name, value, attrs, renderer=None) html += """<script type="text/javascript"> $(document).ready(function() {{ $("#id_{}").select2({{ {} }}); @@ -245,7 +252,7 @@ class Select2Base(Select2Media): for i in self.get_q().all(): yield (i.pk, str(i)) - def render(self, name, value, attrs=None, choices=()): + def render(self, name, value, attrs=None, choices=(), renderer=None): self.remote = str(self.remote) if self.remote in ("None", "false"): # test on lazy object is buggy... so we have this ugly test @@ -328,7 +335,7 @@ class Select2Base(Select2Media): """+</a></span></div>""".format(url_new, self.model.SLUG) ) - html += super(Select2Base, self).render(name, value, attrs) + html += super(Select2Base, self).render(name, value, attrs, renderer=None) html += new html += """<script type="text/javascript"> $(document).ready(function() {{ @@ -355,12 +362,14 @@ class CheckboxSelectMultiple(CheckboxSelectMultipleBase): TODO: test and remove (test case: treatment type not keep on modif) """ - def render(self, name, value, attrs=None, choices=()): + def render(self, name, value, attrs=None, choices=(), renderer=None): if type(value) in (str, str): value = value.split(",") if not isinstance(value, (list, tuple)): value = [value] - return super(CheckboxSelectMultiple, self).render(name, value, attrs) + return super(CheckboxSelectMultiple, self).render( + name, value, attrs, renderer=None + ) class Select2BaseField(object): diff --git a/requirements.txt b/requirements.txt index 4f5630fb3..cb1e85d77 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -six>=1.9 +# six>=1.9 -> dépendance supprimée # gdal==2.4.0 # 3.2 @@ -49,8 +49,7 @@ django-ajax-selects==1.7.0 django-compressor==2.2 # 2.4 -django-formtools==2.0 -# 2.2 +django-formtools==2.2 secretary==0.2.19 unidecode |