Browse Source

Fix Error 500 when try to get ressource that don't exist

master
tr4ck3ur des JM2L 9 years ago
parent
commit
f4f9cb5e63
2 changed files with 9 additions and 6 deletions
  1. +5
    -1
      jm2l/templates/list_tiers.mako
  2. +4
    -5
      jm2l/upload.py

+ 5
- 1
jm2l/templates/list_tiers.mako View File

@@ -3,7 +3,11 @@
<div class="row-fluid">
<div class="span10 offset1">

<a class="pull-right" href="/categorie/entity">Editer les catégories</a>

<span class="pull-right">
<a href="/entity">Ajouter une entitée</a> -
<a href="/categorie/entity">Editer les catégories</a>
</span>
<br>
<div class="tabbable" id="main_tab">
<ul class="nav nav-tabs" style="margin-bottom: 5px;">


+ 4
- 5
jm2l/upload.py View File

@@ -422,7 +422,7 @@ class MediaView(MediaPath):
def mediapath(self,name):
return self.get_mediapath(self.media_table, self.linked_id, name)
@view_config(request_method='GET') #, http_cache = (EXPIRATION_TIME, {'public':True}))
@view_config(request_method='GET', http_cache = (EXPIRATION_TIME, {'public':True}))
def get(self):
name = self.request.matchdict.get('name')
try:
@@ -431,10 +431,9 @@ class MediaView(MediaPath):
self.request.response.content_type = test
except IOError:
pass
#try:
if 1:
try:
self.request.response.body_file = open( self.mediapath(name), 'rb', 10000)
#except IOError:
# raise NotFound
except IOError:
raise NotFound
return self.request.response
##return Response(app_iter=ImgHandle, content_type = 'image/png')

Loading…
Cancel
Save