aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilo Casagrande <milo@ubuntu.com>2014-06-13 15:58:35 +0200
committerMilo Casagrande <milo@ubuntu.com>2014-06-13 15:58:35 +0200
commit3181f586af2c01785cb28be2218ce5a6baafa1de (patch)
tree138ce64cb4e5fb794558a26bdccc2fe8c786f2d9
parentb4da85a85de63cb84459137db9d0a6ae0bd98b01 (diff)
views.py: Fix bug 1328998.
* License text was not shown when Auth-Groups was defined. Change-Id: Ifda3ab35b6f60ef19bf587eef324e86dd489eead
-rw-r--r--license_protected_downloads/views.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/license_protected_downloads/views.py b/license_protected_downloads/views.py
index 0bd690b..0813916 100644
--- a/license_protected_downloads/views.py
+++ b/license_protected_downloads/views.py
@@ -315,23 +315,19 @@ def is_protected(path):
if license_type == "open":
return "OPEN"
- # File matches a license, isn't open.
- if auth_groups:
+ if auth_groups and not license_text:
return "OPEN"
elif license_text:
for i in range(max_index):
- if build_info is not None:
+ if build_info:
license_text = build_info.get("license-text", i)
theme = build_info.get("theme", i)
digest = hashlib.md5(license_text).hexdigest()
digests.append(digest)
_insert_license_into_db(digest, license_text, theme)
else:
- # No license text - file as inaccessible.
- return []
- else:
- # No license found - file is inaccessible.
- return []
+ log.info("No license text or auth groups found: check the "
+ "BUILD-INFO file.")
return digests