Skip to content

Commit

Permalink
[#2575] better fix including other licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Jun 20, 2012
1 parent dfb8f60 commit b6e3681
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions ckan/lib/plugins.py
Expand Up @@ -272,8 +272,6 @@ def setup_template_variables(self, context, data_dict):
c.groups_available = authz_fn(context, data_dict)

c.licences = [('', '')] + base.model.Package.get_license_options()
# this is a hack to fix #2575 but needs sorting properly
c.licences[1] = (base._("License Not Specified"), c.licences[1][1])
c.is_sysadmin = authz.Authorizer().is_sysadmin(c.user)

if c.pkg:
Expand Down
9 changes: 7 additions & 2 deletions ckan/model/license.py
Expand Up @@ -46,7 +46,12 @@ def __init__(self):
if group_url:
self.load_licenses(group_url)
else:
default_license_list = [
self.licenses = self.get_license_info

@property
def get_license_info(self):
# this allows the license info to be localised see #2575
default_license_list = [
{
"domain_content": False,
"domain_data": False,
Expand Down Expand Up @@ -249,7 +254,7 @@ def __init__(self):
"url": ""
}
]
self._create_license_list(default_license_list)
return [License(entity) for entity in default_license_list]

def load_licenses(self, license_url):
try:
Expand Down

0 comments on commit b6e3681

Please sign in to comment.