Skip to content

Commit

Permalink
Revert "[#368] Add num_followers to group schema"
Browse files Browse the repository at this point in the history
This reverts commit c7bc315.
  • Loading branch information
domoritz committed Mar 6, 2013
1 parent c7bc315 commit eb921d0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
3 changes: 0 additions & 3 deletions ckan/lib/navl/validators.py
Expand Up @@ -92,6 +92,3 @@ def convert_int(value, context):
except ValueError:
raise Invalid(_('Please enter an integer value'))

def read_only_validator(value, context):

return value
7 changes: 3 additions & 4 deletions ckan/logic/action/get.py
Expand Up @@ -845,13 +845,12 @@ def _group_or_org_show(context, data_dict, is_org=False):
except AttributeError:
schema = group_plugin.db_to_form_schema()

group_dict['num_followers'] = logic.get_action('group_follower_count')(
{'model': model, 'session': model.Session},
{'id': group_dict['id']})

if schema:
group_dict, errors = _validate(group_dict, schema, context=context)

group_dict['num_followers'] = logic.get_action('group_follower_count')(
{'model': model, 'session': model.Session},
{'id': group_dict['id']})
return group_dict


Expand Down
4 changes: 1 addition & 3 deletions ckan/logic/schema.py
Expand Up @@ -5,8 +5,7 @@
ignore,
if_empty_same_as,
not_missing,
ignore_empty,
read_only_validator
ignore_empty
)
from ckan.logic.validators import (package_id_not_changed,
package_id_exists,
Expand Down Expand Up @@ -307,7 +306,6 @@ def default_group_schema():
def group_form_schema():
schema = default_group_schema()
#schema['extras_validation'] = [duplicate_extras_key, ignore]
schema['num_followers'] = [ignore_missing, int_validator, read_only_validator]
schema['packages'] = {
"name": [not_empty, unicode],
"title": [ignore_missing],
Expand Down

0 comments on commit eb921d0

Please sign in to comment.