Commit 50d663a8 authored by Flavio TARSETTI's avatar Flavio TARSETTI
Browse files

Merge branch 'remove_python2_imports' into 'django3_migration'

Remove Python2 imports

See merge request !377
parents d1f7392b ee4cce4c
Pipeline #42967 passed with stage
in 14 minutes and 25 seconds
......@@ -29,6 +29,7 @@
import datetime
import sys
from urllib.parse import urlparse
from django.conf import settings
from django.db import models
......@@ -41,11 +42,6 @@ from ...models import Profile
from ...models import SupervisionTrack
from ...models import TemporaryUrl
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
class Command(InteractiveCommand):
......
......@@ -28,17 +28,13 @@
from __future__ import unicode_literals
import datetime
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.db import migrations
from django.template import loader
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
def set_profile_state(apps, schema_editor):
"""Set profile status"""
......
......@@ -27,15 +27,11 @@
import os
import shutil
from urllib.parse import urlparse
from django.conf import settings
from django.test import TestCase
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from .models import Shareable
......
......@@ -27,11 +27,7 @@
import datetime
import re
try:
from functools import reduce
except ImportError:
pass
from functools import reduce
from django.db.models import Q
......
......@@ -27,11 +27,7 @@
import datetime
try:
from itertools import izip_longest
except ImportError:
from itertools import zip_longest as izip_longest
from itertools import zip_longest
import simplejson
from django.contrib.auth.decorators import login_required
......@@ -167,7 +163,7 @@ def convert_values(stats):
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return izip_longest(fillvalue=fillvalue, *args)
return zip_longest(fillvalue=fillvalue, *args)
def get_statistics(hours_to_go_back, cluster_by):
......
......@@ -29,11 +29,7 @@ import datetime
import hashlib
import random
import re
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from urllib.parse import urlparse
from django.conf import settings
from django.contrib.auth.models import User
......
......@@ -27,6 +27,8 @@
import datetime
import logging
from urllib.parse import urlparse
from django.conf import settings
from django.contrib import messages
......@@ -52,13 +54,6 @@ from ..common.models import Shareable
from ..utils import mail
from .registration.forms import BlockedUserRevalidationForm
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import logging
logger = logging.getLogger(__name__)
......
......@@ -25,9 +25,12 @@
# #
###############################################################################
from urllib.parse import urlparse
from django.conf import settings
from django.conf.urls import include
from django.conf.urls import url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from drf_yasg import openapi
from drf_yasg.views import get_schema_view
......@@ -36,13 +39,6 @@ from rest_framework import permissions
from .navigation import urls as navigation_urls
from .ui import urls as ui_urls
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
from django.contrib import admin
admin.autodiscover()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment