From 6241ab2a9292ba7e97034eac5f1218e90aedddc5 Mon Sep 17 00:00:00 2001 From: Greg Lange Date: Wed, 5 Feb 2014 22:50:31 +0000 Subject: [PATCH] Fix a couple ifs in account quota middleware. Unless I'm misunderstanding something, this is better/more correct. Change-Id: I6c62fbfdddea908a2671021a34fa25600b0dff45 --- swift/common/middleware/account_quotas.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/common/middleware/account_quotas.py b/swift/common/middleware/account_quotas.py index d91f90f209..e4aa235049 100644 --- a/swift/common/middleware/account_quotas.py +++ b/swift/common/middleware/account_quotas.py @@ -103,7 +103,7 @@ class AccountQuotaMiddleware(object): if new_quota is not None: return HTTPForbidden() - if obj and request.method == "POST" or not obj: + if request.method == "POST" or not obj: return self.app if request.method == 'COPY': @@ -123,7 +123,7 @@ class AccountQuotaMiddleware(object): if quota < 0: return self.app - if obj and copy_from: + if copy_from: path = '/' + ver + '/' + account + '/' + copy_from.lstrip('/') object_info = get_object_info(request.environ, self.app, path) if not object_info or not object_info['length']: