mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-19 10:14:38 +00:00
Fix urlparse imports
This commit is contained in:
parent
9c994fba61
commit
c70e6804df
@ -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}'
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user