Commit b66b2626 authored by Marko Kuder's avatar Marko Kuder
Browse files

Merge branch 'fix/sop-number-error' into 'development'

Fix sop number error

See merge request !12
parents 8b097675 83ca63a9
# -*- 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