update imports

This commit is contained in:
Johannes Wilm 2022-07-16 22:26:58 +02:00
parent a1aae28859
commit 03c95bc925
11 changed files with 17 additions and 68 deletions

View file

@ -1,9 +1,6 @@
import six
from django.contrib import admin
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.utils.translation import gettext_lazy as _
from django.template.loader import render_to_string

View file

@ -1,6 +1,7 @@
from django.conf import settings
from PIL import Image
from django.conf import settings
from appconf import AppConf

View file

@ -1,14 +1,9 @@
import os
import six
from django import forms
from django.forms import widgets
from django.utils.safestring import mark_safe
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.utils.translation import gettext_lazy as _
from django.template.defaultfilters import filesizeformat

View file

@ -1,6 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import avatar.models

View file

@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-16 08:50
from __future__ import unicode_literals
import avatar.models
from django.conf import settings
import django.core.files.storage

View file

@ -1,7 +1,3 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-27 13:45
from __future__ import unicode_literals
import avatar.models
from django.db import migrations

View file

@ -2,6 +2,7 @@ import binascii
import datetime
import os
import hashlib
import six
from PIL import Image
from django.db import models
@ -12,21 +13,11 @@ from django.utils.module_loading import import_string
from django.utils.translation import gettext_lazy as _
from django.utils.encoding import force_str
from django.db.models import signals
from django.utils.timezone import now
from avatar.conf import settings
from avatar.utils import get_username, force_bytes, invalidate_cache
try:
from django.utils.timezone import now
except ImportError:
now = datetime.datetime.now
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
avatar_storage = get_storage_class(settings.AVATAR_STORAGE)()

View file

@ -1,11 +1,7 @@
import hashlib
from urllib.parse import urljoin, urlencode
try:
from urllib.parse import urljoin, urlencode
except ImportError:
from urlparse import urljoin
from urllib import urlencode
from django.utils.module_loading import import_string
from avatar.conf import settings
from avatar.utils import (
@ -14,7 +10,6 @@ from avatar.utils import (
get_primary_avatar,
)
from django.utils.module_loading import import_string
# If the FacebookAvatarProvider is used, a mechanism needs to be defined on
# how to obtain the user's Facebook UID. This is done via

View file

@ -1,15 +1,9 @@
import six
from django import template
try:
from django.urls import reverse
except ImportError:
# For Django < 1.10
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.template.loader import render_to_string
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.utils.translation import gettext as _
from django.utils.module_loading import import_string

View file

@ -1,19 +1,9 @@
import hashlib
import six
from django.core.cache import cache
from django.template.defaultfilters import slugify
try:
from django.utils.encoding import force_bytes
except ImportError:
force_bytes = str
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.utils.encoding import force_bytes
from django.contrib.auth import get_user_model
from avatar.conf import settings

View file

@ -1,10 +1,7 @@
import six
from django.shortcuts import render, redirect
from django.utils.translation import gettext as _
# Issue 182: six no longer included with Django 3.0
try:
from django.utils import six
except ImportError:
import six
from django.contrib import messages
from django.contrib.auth.decorators import login_required