Ver a proveniência

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

master
tr4ck3ur des JM2L há 9 anos
ascendente
cometimento
f4f9cb5e63
2 ficheiros alterados com 9 adições e 6 eliminações
  1. +5
    -1
      jm2l/templates/list_tiers.mako
  2. +4
    -5
      jm2l/upload.py

+ 5
- 1
jm2l/templates/list_tiers.mako Ver ficheiro

@@ -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 Ver ficheiro

@@ -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')

Carregando…
Cancelar
Guardar