Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
ADIM
Commits
b450c1af
Commit
b450c1af
authored
Sep 18, 2014
by
Julien Furrer
Browse files
Add cache control to send image
parent
2b49e6dd
Changes
1
Show whitespace changes
Inline
Side-by-side
adim_app/views.py
View file @
b450c1af
...
...
@@ -7,6 +7,7 @@ from django.http.response import HttpResponse, HttpResponseBadRequest, HttpRespo
from
django.shortcuts
import
render
,
get_object_or_404
from
django.contrib.auth.decorators
import
login_required
from
django.views.decorators.http
import
require_POST
from
django.views.decorators.cache
import
cache_control
from
PIL
import
Image
from
adim.models
import
AnObj
from
.forms
import
UploadImageFileForm
...
...
@@ -68,6 +69,7 @@ def _get_anobj(request, anobj_uuid=None, anobj_id=None):
@
login_required
@
cache_control
(
public
=
True
,
max_age
=
120
)
def
send_anobj_img
(
request
,
anobj_uuid
):
try
:
anobj
=
_get_anobj
(
request
,
anobj_uuid
=
anobj_uuid
)
...
...
Write
Preview
Supports
Markdown
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