From 07e3e2e9c3da9f05634a45f65723504c229f2baa Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 18 May 2022 16:23:02 +0200 Subject: Migration to Django 2.2 - many fixes - remove redondant permissions - fix missing kwargs for widget and form fields - fix default to callable for model field - quick and dirty fix for datepicker - is_authenticated() -> is_authenticated - fix registration urls - remove six usage (no more python2) --- ishtar_common/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ishtar_common/utils.py') 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 -- cgit v1.2.3