Fix urlparse imports

This commit is contained in:
Adrian Moennich 2020-11-10 13:11:01 +01:00
parent 9c994fba61
commit c70e6804df
2 changed files with 5 additions and 4 deletions

View File

@ -6,10 +6,10 @@
# see the LICENSE file for more details.
import socket
from urllib.parse import urlparse
import requests
from flask_pluginengine import current_plugin
from urllib2 import urlparse
class PiwikRequest:
@ -29,7 +29,7 @@ class PiwikRequest:
@property
def api_url(self):
url = urlparse.urlparse(self.server_url)
url = urlparse(self.server_url)
scheme = url.scheme if url.scheme else 'https'
return f'{scheme}://{url.netloc}{url.path}{self.query_script}'

View File

@ -5,9 +5,10 @@
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from urllib.parse import urlparse
from flask import request, session
from flask_pluginengine import render_plugin_template
from urllib2 import urlparse
from indico.core import signals
from indico.core.plugins import IndicoPlugin, IndicoPluginBlueprint, plugin_url_rule_to_js, url_for_plugin
@ -110,7 +111,7 @@ class PiwikPlugin(IndicoPlugin):
def _get_tracking_url(self):
url = self.settings.get('server_url')
url = url if url.endswith('/') else url + '/'
url = urlparse.urlparse(url)
url = urlparse(url)
return url.netloc + url.path