Skip to content

*_member_create don't raise validation errors#3108

Merged
wardi merged 4 commits intomasterfrom
3108-validation-errors-on-member-create
Jun 15, 2016
Merged

*_member_create don't raise validation errors#3108
wardi merged 4 commits intomasterfrom
3108-validation-errors-on-member-create

Conversation

@amercader
Copy link
Copy Markdown
Member

organization_member_create and group_member_create don't raise validation errors if one of the parameters is missing (id, username or role, all mandatory).

This leads to confusing failures when submitting eg a key with an extra space ("username "):

(ProgrammingError) can't adapt type 'Missing' 'SELECT "user".password AS user_password, "user".id AS user_id, "user".name AS user_name, "user".openid AS user_openid, "user".fullname AS user_fullname, "user".email AS user_email, "user".apikey AS user_apikey, "user".created AS user_created, "user".reset_key AS user_reset_key, "user".about AS user_about, "user".activity_streams_email_notifications AS user_activity_streams_email_notifications, "user".sysadmin AS user_sysadmin, "user".state AS user_state \\nFROM "user" \\nWHERE "user".name = %(name_1)s ORDER BY "user".name \\n LIMIT %(param_1)s' {'name_1': <ckan.lib.navl.dictization_functions.Missing object at 0x7fb32056be10>, 'param_1': 1}

Add not_missing to the schema and raise the errors on the action. Adds
some tests as well

@classmethod
def teardown_class(cls):
p.unload('image_view')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this related?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened here, I pushed a commit fixing it

@wardi wardi merged commit eb943c9 into master Jun 15, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
Add not_missing to the schema and raise the errors on the action. Adds
some tests as well
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
amercader added a commit that referenced this pull request Aug 25, 2016
@smotornyuk smotornyuk deleted the 3108-validation-errors-on-member-create branch December 19, 2018 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants