Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSWeb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSWeb
Commits
f74f9716
Commit
f74f9716
authored
8 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Possible fix for TypeError
parent
4e209daf
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VIPSWeb/views.py
+4
-9
4 additions, 9 deletions
VIPSWeb/views.py
with
4 additions
and
9 deletions
VIPSWeb/views.py
+
4
−
9
View file @
f74f9716
...
...
@@ -18,7 +18,7 @@
# @author: Tor-Einar Skog <tor-einar.skog@nibio.no>
import
datetime
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
,
JsonResponse
,
HttpResponseBadRequest
,
HttpResponseNotAllowed
from
django.http
import
HttpResponse
,
HttpResponseBadRequest
,
HttpResponseNotAllowed
from
django.conf
import
settings
from
django.utils
import
translation
import
requests
...
...
@@ -87,19 +87,14 @@ def vipslogicproxy(request, path):
else
:
return
HttpResponseNotAllowed
(
"
Permitted methods are POST and GET
"
)
params
=
request
.
urlencode
()
#print params
#print
"Params:" +
params
try
:
url
=
"
%s://%s/%s
"
%
(
settings
.
VIPSLOGIC_PROTOCOL
,
settings
.
VIPSLOGIC_SERVER_NAME
,
path
)
print
url
#
print url
except
KeyError
:
return
HttpResponseBadRequest
(
"
URL must be defined
"
)
response
=
r
(
url
,
params
=
params
)
response
=
r
(
url
.
encode
(
"
ascii
"
),
params
=
params
.
encode
(
"
ascii
"
)
)
if
response
.
status_code
==
200
:
return
HttpResponse
(
response
.
text
,
status
=
int
(
response
.
status_code
),
content_type
=
response
.
headers
.
get
(
'
content-type
'
,
"
text/plain
"
))
else
:
return
HttpResponse
(
"
[]
"
,
status
=
200
,
content_type
=
"
application/json
"
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment