Skip to content
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.

Bug 1006569 - [privacy] Add checkbox at sign-up #135

Closed
wants to merge 4 commits into from

Conversation

bitgeeky
Copy link
Contributor

Functionally works fine for me and all the tests pass too.
I will add the unit tests and modify helper text later today and need to discuss about the deletion of user email from database usecase.

@@ -5,6 +5,7 @@
from django.db import models

from tower import ugettext_lazy as _lazy
from random import randint
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will remove in next commit.

@bobsilverberg
Copy link
Contributor

I think that once a person accepts the privacy policy via the checkbox they cannot unaccept it, so we should only display the check box when it is empty. Once a user has accepted it the checkbox should no longer appear on the form. You will need to write some custom code to output the form in users/templates/users/profile/edit.html instead of just using {{ form.as_p() }}. Take a look at the task form [1] for some examples.

You would probably have to do this anyway to get the form to match the wireframe.

[1] https://github.com/mozilla/oneanddone/blob/master/oneanddone/tasks/templates/tasks/form.html

@bobsilverberg
Copy link
Contributor

It's a good start @bitgeeky. Nice work. Please address the comments above and let me know when it's ready for another review.

@bobsilverberg
Copy link
Contributor

Also, @bitgeeky, please attach the PR to the bug and request review from me when it's ready. That is a better method than pinging me on IRC and makes everything easier to track.

@bitgeeky
Copy link
Contributor Author

Made the changes suggested in comments. @bobsilverberg r ?

username = forms.RegexField(
label= "Username https://oneanddone.mozilla.org/en-US/profile/",
max_length=30, regex=r'^[a-zA-Z0-9]+$',
error_messages = {'invalid': "This value may contain only alphanumeric characters. ( r'^[a-zA-Z0-9]+$' )"})
Copy link
Contributor

Choose a reason for hiding this comment

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

We should not include the regex in the error message. That is going to be meaningless to 99% of the people who see it and will only serve to confuse them.

@bobsilverberg
Copy link
Contributor

Great work, @bitgeeky, it looks really good. I like the way you solved the duplicate username/recursion issue, and the way you created a separate form to deal with the fact that sometimes we need a checkbox and sometimes we do not.

There are a few comments above, and one other thing I wanted to add is that I think it would be nice to show a confirmation message at the top of the screen after a user successfully saves the form, like we do with the Task form. Try creating or saving a task and you'll see what I mean.

Let me know when those changes are ready for another review.

@bitgeeky
Copy link
Contributor Author

Made suggested display changes. @bobsilverberg r ?

label = _("You are creating a profile that will include a public username and work history. You will begin to receive email communications from Mozilla once you have completed tasks. You may unsubscribe at anytime by clicking the line at the bottom of these emails."),
required = True,)
username = forms.RegexField(
label= "Username:",
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing i18n for label

@bitgeeky
Copy link
Contributor Author

@bobsilverberg r ?

@bobsilverberg
Copy link
Contributor

This was merged via fd291af

Thanks @bitgeeky

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