Skip to content

Commit

Permalink
Add another common example to error message
Browse files Browse the repository at this point in the history
Inserting a value with a different type from the field one is a common
error, so hopefully this will give more clues (see ckan#1964, ckan#1963)
  • Loading branch information
amercader committed Jan 14, 2015
1 parent 2908505 commit 59975ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ckanext/datastore/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,8 @@ def upsert_data(context, data_dict):
except sqlalchemy.exc.DataError as err:
raise InvalidDataError(
toolkit._("The data was invalid (for example: a numeric value "
"is out of range)."))
"is out of range or was inserted into a text field)."
))

elif method in [_UPDATE, _UPSERT]:
unique_keys = _get_unique_key(context, data_dict)
Expand Down

0 comments on commit 59975ba

Please sign in to comment.