Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

212 password change #254

Merged
merged 11 commits into from Oct 16, 2017
Merged

212 password change #254

merged 11 commits into from Oct 16, 2017

Conversation

Lobosque
Copy link
Contributor

@Lobosque Lobosque commented Oct 3, 2017

Fixes #212

  • Updates UpdateUserInfoForm to accept password change;
  • Add "Change Password" section in the settings forms;
  • Modify the settings form javascript to work for N tabs

@Lobosque
Copy link
Contributor Author

Lobosque commented Oct 3, 2017

@dethos How do you think the new password form should behave for users that registered using GithubOauth? (there is no current password for these cases).

{{ form.current_password.errors }} {{ form.current_password.label_tag }} {{ form.current_password }}
</div>
<div class="form__block">
{{ form.new_password2.errors }} {{ form.new_password1.label_tag }} {{ form.new_password1 }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this is a typo, should be {{ form.new_password1.errors }}

@Lobosque
Copy link
Contributor Author

Lobosque commented Oct 3, 2017 via email

@dethos
Copy link
Collaborator

dethos commented Oct 13, 2017

@Lobosque for users who signed up using Github, we should not display the change password tab or to make it clear, instead of the form a message could be displayed saying that since they used Oauth there is not need to update passwords.

By the way, thanks for your contribution. As soon as you hide the tab or display that message, I will make a full review and merge the PR (on a first look everything appears to be fine 👍 )

Copy link
Collaborator

@dethos dethos left a comment

Choose a reason for hiding this comment

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

After testing a bit I found a small issue.

Also #tab4 is missing here: https://github.com/whitesmith/hawkpost/pull/254/files#diff-634d4c9620895e0cdf312c07c3ad90b6R49

$("#tab3").addClass("active");
$("#tab1").removeClass("active");
$("#tab2").removeClass("active");
$(".sett__nav__item").click(function(evt) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

For some reason this event is not being added to #tab4 (at least on Firefox)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested here on Firefox and it triggers the event just fine.
Maybe a version issue? Can you try again?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just tested again, with different browsers and it is working fine. Not sure what was the problem the other time.

@dethos dethos self-assigned this Oct 13, 2017
Copy link
Contributor Author

@Lobosque Lobosque left a comment

Choose a reason for hiding this comment

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

@dethos I added a commit to hide the change password section from github signups.
However I couldn't reproduce the tab problem. All of them worked just fine in both Chrome and Firefox.

$("#tab3").addClass("active");
$("#tab1").removeClass("active");
$("#tab2").removeClass("active");
$(".sett__nav__item").click(function(evt) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested here on Firefox and it triggers the event just fine.
Maybe a version issue? Can you try again?

Copy link
Collaborator

@dethos dethos left a comment

Choose a reason for hiding this comment

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

Just a small observation

humans/forms.py Outdated
self.pub_key = None
return super().__init__(*args, **kwargs)
return super(UpdateUserInfoForm, self).__init__(*args, **kwargs)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change? This is a Python 3 project, there is no need to call super using the old "style".

humans/forms.py Outdated
new_password = self.cleaned_data.get('new_password2')
if self.change_password:
self.instance.set_password(new_password)
return super(UpdateUserInfoForm, self).save(commit=commit)
Copy link
Collaborator

Choose a reason for hiding this comment

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

here super can also be changed to the new style

@dethos dethos merged commit 648e808 into master Oct 16, 2017
@dethos dethos deleted the 212-password-change branch October 16, 2017 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants