Commit 07a9c8c8 by aa.gusti

perbaikan get_urls

1 parent df92e247
...@@ -2,10 +2,10 @@ import locale ...@@ -2,10 +2,10 @@ import locale
import logging import logging
import re import re
# from opensipkd.tools.captcha import get_captcha_url
from .routes import routes from .routes import routes
# from opensipkd.tools.captcha import get_captcha_url
try: try:
from urllib import (urlencode, quote, quote_plus, ) from urllib import (urlencode, quote, quote_plus, )
except ImportError: except ImportError:
...@@ -417,8 +417,11 @@ def get_urls(url): ...@@ -417,8 +417,11 @@ def get_urls(url):
if home: if home:
urls = url.split(":") urls = url.split(":")
homes = home.split(":") homes = home.split(":")
if urls[0] != homes[0]: if len(urls) > 0:
return ":".join([homes[0], ":".join(urls[1:])]) if urls[0] != homes[0]:
return ":".join([homes[0], ":".join(urls[1:])])
else:
return home + url
return url return url
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!