Merge "Modify the empty list ensure method"
This commit is contained in:
commit
2a1ce3a498
|
@ -228,10 +228,10 @@ class ImagesController(object):
|
|||
path = change['path']
|
||||
path_root = path[0]
|
||||
value = change['value']
|
||||
if path_root == 'locations' and value == []:
|
||||
if path_root == 'locations' and not value:
|
||||
msg = _("Cannot set locations to empty list.")
|
||||
raise webob.exc.HTTPForbidden(msg)
|
||||
elif path_root == 'locations' and value != []:
|
||||
elif path_root == 'locations' and value:
|
||||
self._do_replace_locations(image, value)
|
||||
elif path_root == 'owner' and req.context.is_admin == False:
|
||||
msg = _("Owner can't be updated by non admin.")
|
||||
|
|
|
@ -72,7 +72,7 @@ class V2Token(object):
|
|||
service = catalog[-1]
|
||||
endpoint_list = []
|
||||
|
||||
if region_list == []:
|
||||
if not region_list:
|
||||
endpoint_list.append(self.base_endpoint)
|
||||
else:
|
||||
for region in region_list:
|
||||
|
|
Loading…
Reference in New Issue