Commit 83ca63a9 authored by Kristijan Čagran's avatar Kristijan Čagran
Browse files

Fix sop number error

parent 8b097675
# -*- encoding: utf-8 -*-
import exceptions
import re
import urllib2
from urllib import urlencode
......@@ -266,6 +267,8 @@ class PackageController(ckan.controllers.package.PackageController):
if title.find('\n') > 0:
title = title[0:title.find('\n')].strip()
return '{"name": "'+ title + '" , "url": "' + (PISRS_URL + id)+'"}'
except exceptions.UnicodeError:
return '{"name": "Vnos ni v pravilnem formatu." , "url":""}'
except URLError:
return '{"name": "Napaka pri poizvedbi SOP" , "url":' + (PISRS_URL + id) + '"}'
return '{"name": "Predpis s tem SOP ni bil najden" , "url": "' + (PISRS_URL + id) + '"}'
......
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