Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Improve textcha for registration #823

Open
artcz opened this issue Sep 9, 2018 · 2 comments
Open

Improve textcha for registration #823

artcz opened this issue Sep 9, 2018 · 2 comments
Assignees

Comments

@artcz
Copy link
Contributor

artcz commented Sep 9, 2018

Currently all the logic is put inside NewAccountForm and it only supports single case-sensitive answer (it only does .strip() on the input)

Things to fix:

  • Check should be case insensitive (eg. "Three" and "three" are both correct answer)
  • We should be able to support multiple answers (eg. "3" and "three" are both correct) (note: maybe we just specify all correct answer in the model as a comma separated string?)
  • encapsulate the logic – so that it's easier to integrate it in other places if we need it + we could put less logic in the NewAccountForm
  • maybe write a separate set of unit tests for this as well.
@ethancarlsson
Copy link
Contributor

I've been working on this one. Seems that the biggest challenge is seperating the textcha and the NewAccountForm logic. Best I can come up with is simply letting the NewAccountForm inherit from a new textcha form class.

@malemburg
Copy link
Member

The check for the textcha should use regular expressions.

Here's how Mailman does this: https://bazaar.launchpad.net/~mailman-coders/mailman/2.1/view/head:/Mailman/Defaults.py.in#L134

I don't think you need to separate the logic. It's really only needed when opening new accounts.

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

No branches or pull requests

4 participants