diff --git a/ckan/lib/plugins.py b/ckan/lib/plugins.py index 2fccd93ec03..20910fb6aeb 100644 --- a/ckan/lib/plugins.py +++ b/ckan/lib/plugins.py @@ -349,9 +349,6 @@ def history_template(self): def group_form(self): return 'group/new_group_form.html' - def form_to_db_schema(self): - return logic.schema.group_form_schema() - def form_to_db_schema_options(self, options): ''' This allows us to select different schemas for different purpose eg via the web interface or via the api or creation vs @@ -366,11 +363,20 @@ def form_to_db_schema_options(self, options): if options.get('api'): if options.get('type') == 'create': - return logic.schema.default_group_schema() + return self.form_to_db_schema_api_create() else: - return logic.schema.default_update_group_schema() + return self.form_to_db_schema_api_update() else: - return logic.schema.group_form_schema() + return self.form_to_db_schema() + + def form_to_db_schema_api_create(self): + return logic.schema.default_group_schema() + + def form_to_db_schema_api_update(self): + return logic.schema.default_update_group_schema() + + def form_to_db_schema(self): + return logic.schema.group_form_schema() def db_to_form_schema(self): '''This is an interface to manipulate data from the database