This repository has been archived by the owner. It is now read-only.

Fix unexpected captcha iden in response #750

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

buddydvd commented Apr 24, 2013

This pull requests fixes two issues with regards to unexpected captcha identifier sent in API call responses. For clarity, I separated the fix for both issues into two commits.


Issue 1: When a submission call succeeds, the server may attach an unexpected captcha identifier to the response.

The reason why this happens is because c.errors contains all errors detected by Validators (many of which are ignored by the controller methods). On the other hand, form.has_error() returns true if there exist errors that were explicitly set in controller methods with has_errors(...) and set_error(...).

For example, when a link submission succeeds, c.errors contains the following values:

  • ('NO_TEXT', 'extension')
  • ('NO_TEXT', 'text')

while form.has_error() returns False.


Issue 2: When a submission call fails for a user that doesn't need captcha, the server always attach an unexpected captcha identifier.

The change avoids sending captcha iden for failed API calls by users that don't need it.

Contributor

bsimpson63 commented May 3, 2013

Looks good 🐟

Contributor

buddydvd commented May 3, 2013

Thanks for taking the time to review these changes. Greatly appreciated!

Contributor

bsimpson63 commented May 3, 2013

Thanks for your contributions. I'll try to get this and the subreddit suggest one pushed out early next week.

Contributor

bsimpson63 commented May 9, 2013

@bsimpson63 bsimpson63 closed this May 9, 2013

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.