Skip to content

Commit

Permalink
Use db_to_form_package_schema() by default
Browse files Browse the repository at this point in the history
Make DefaultDatasetForm's db_to_form_schema() method return
db_to_form_package_schema() rather than None, so that validation against
db_to_form_package_schema() is done by default, even when there's no
IDatasetForm plugin active.

The reason for this is that bugs in db_to_form_package_schema() can
cause pages to crash, features to stop working, etc., but the tests
currently do not catch these bugs because db_to_form_package_schema() is
only used when an IDatasetForm plugin that returns a schema based on
db_to_form_package_schema() is active, and no such plugin is active when
the tests run.
  • Loading branch information
Sean Hammond authored and tobes committed Feb 20, 2013
1 parent 14716b7 commit 3e072c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ckan/lib/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def form_to_db_schema_api_update(self):
def db_to_form_schema(self):
'''This is an interface to manipulate data from the database
into a format suitable for the form (optional)'''
return logic.schema.db_to_form_package_schema()

def db_to_form_schema_options(self, options):
'''This allows the selectino of different schemas for different
Expand Down

0 comments on commit 3e072c6

Please sign in to comment.