Skip to content

Commit

Permalink
[#795] Fix and deprecate model.Package.is_private
Browse files Browse the repository at this point in the history
  • Loading branch information
tobes committed Apr 23, 2013
1 parent 370cbf8 commit dc93ab9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ckan/model/package.py
Expand Up @@ -18,6 +18,7 @@
import extension

import ckan.lib.dictization
import ckan.lib.maintain as maintain

__all__ = ['Package', 'package_table', 'package_revision_table',
'PACKAGE_NAME_MAX_LENGTH', 'PACKAGE_NAME_MIN_LENGTH',
Expand Down Expand Up @@ -510,11 +511,15 @@ def metadata_modified(self):
return datetime.datetime.utcfromtimestamp(timestamp_float)

@property
@maintain.deprecated('`is_private` attriute of model.Package is ' +
'deprecated and should not be used. Use `private`')
def is_private(self):
"""
DEPRECATED in 2.1
A package is private if belongs to any private groups
"""
return bool(self.get_groups(capacity='private'))
return self.private

def is_in_group(self, group):
return group in self.get_groups()
Expand Down

0 comments on commit dc93ab9

Please sign in to comment.