Project

General

Profile

Bug #8571

Un accès à /backoffice/admin/roles/SQDSQD devrait retourner une 404

Added by Frédéric Péters over 6 years ago. Updated about 6 years ago.

Status:
Fermé
Priority:
Normal
Assignee:
-
Target version:
Start date:
08 Oct 2015
Due date:
% Done:

0%

Estimated time:
Patch proposed:
Yes
Planning:

Description

Si l'id n'existe pas, on a pour le moment une trace, il faudrait une 404.

:
  type = '<type 'exceptions.KeyError'>', value = ''

Stack trace (most recent call first):
  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 340, in get_filename
   338             if ignore_errors:
   339                 return None
>  340             raise KeyError()
   341         except ImportError as e:
   342             if ignore_errors:

  locals: 
     ignore_errors = False
     ignore_migration = False
     cls = <class 'wcs.roles.Role'>
     filename = '/var/lib/wcs-au-quotidien/meaux.test.au-quotidien.com/roles/35c'

  File "/usr/lib/python2.7/dist-packages/wcs/qommon/storage.py", line 279, in get
   277         filename = os.path.join(cls.get_objects_dir(), fix_key(id))
   278         return cls.get_filename(filename, ignore_errors=ignore_errors,
>  279                                 ignore_migration=ignore_migration)
   280     get = classmethod(get)
   281 

  locals: 
     ignore_errors = False
     ignore_migration = False
     id = '35c'
     cls = <class 'wcs.roles.Role'>
     filename = '/var/lib/wcs-au-quotidien/meaux.test.au-quotidien.com/roles/35c'

  File "/usr/lib/python2.7/dist-packages/wcs/admin/roles.py", line 76, in __init__
    74 
    75     def __init__(self, component):
>   76         self.role = Role.get(component)
    77         self.role_ui = RoleUI(self.role)
    78         get_response().breadcrumb.append((component + '/', self.role.name))

  locals: 
     self = <wcs.admin.roles.RolePage object at 0x6931590>
     component = '35c'

Files

Associated revisions

Revision 5fefd560 (diff)
Added by Frédéric Péters about 6 years ago

backoffice: return 404 for URIs that do not match any role (#8571)

History

#1

Updated by Frédéric Péters about 6 years ago

#2

Updated by Benjamin Dauvergne about 6 years ago

Ack.

#3

Updated by Frédéric Péters about 6 years ago

  • Status changed from En cours to Résolu (à déployer)
commit 5fefd5603eb622b13eb22935ce88cd224a6cc359
Author: Frédéric Péters <fpeters@entrouvert.com>
Date:   Mon Dec 28 17:07:34 2015 +0100

    backoffice: return 404 for URIs that do not match any role (#8571)
#4

Updated by Frédéric Péters about 6 years ago

  • Target version set to v1.26
#5

Updated by Thomas Noël about 6 years ago

  • Status changed from Résolu (à déployer) to Fermé

Also available in: Atom PDF