Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
768d35f7
Commit
768d35f7
authored
May 24, 2012
by
Sofia Papagiannaki
Browse files
fix feedback service, handle URLError
parent
02c92a76
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-pithos-app/pithos/api/delegate.py
View file @
768d35f7
...
...
@@ -76,7 +76,6 @@ def delegate_to_feedback_service(request):
uri
=
proto
+
p
.
netloc
+
'/im/service/api/v2.0/feedback'
headers
=
{
'X-Auth-Token'
:
SERVICE_TOKEN
}
headers
=
{}
values
=
dict
([(
k
,
v
)
for
k
,
v
in
request
.
POST
.
items
()])
data
=
urllib
.
urlencode
(
values
)
req
=
urllib2
.
Request
(
uri
,
data
,
headers
)
...
...
@@ -84,4 +83,6 @@ def delegate_to_feedback_service(request):
urllib2
.
urlopen
(
req
)
except
urllib2
.
HTTPError
,
e
:
return
HttpResponse
(
status
=
e
.
code
)
except
urllib2
.
URLError
,
e
:
return
HttpResponseNotFound
(
e
)
return
HttpResponse
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment