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

Allow bio updation without current password #7806

Merged
merged 1 commit into from
Oct 7, 2020

Conversation

Tlazypanda
Copy link
Collaborator

Fixes #7756

Modified the user controller to allow bio updation without entering current password.

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

GIF

bio

Thanks!

@Tlazypanda Tlazypanda requested a review from a team as a code owner April 11, 2020 00:47
@codecov
Copy link

codecov bot commented Apr 11, 2020

Codecov Report

Merging #7806 into main will decrease coverage by 0.04%.
The diff coverage is 82.94%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7806      +/-   ##
==========================================
- Coverage   81.94%   81.89%   -0.05%     
==========================================
  Files          97      101       +4     
  Lines        5627     5894     +267     
==========================================
+ Hits         4611     4827     +216     
- Misses       1016     1067      +51     
Impacted Files Coverage Δ
app/models/concerns/statistics.rb 96.72% <ø> (ø)
app/models/drupal_content_type_map.rb 92.59% <ø> (-0.27%) ⬇️
app/mailers/admin_mailer.rb 90.90% <12.50%> (-9.10%) ⬇️
app/jobs/digest_spam_job.rb 33.33% <33.33%> (ø)
app/models/user.rb 87.68% <45.00%> (-3.37%) ⬇️
app/controllers/spam2_controller.rb 71.84% <71.84%> (ø)
app/controllers/users_controller.rb 81.04% <80.00%> (-1.26%) ⬇️
app/models/comment.rb 77.51% <83.33%> (+0.62%) ⬆️
app/controllers/notes_controller.rb 83.46% <88.88%> (+0.06%) ⬆️
app/controllers/batch_controller.rb 90.19% <90.19%> (ø)
... and 46 more

@Tlazypanda
Copy link
Collaborator Author

@jywarren @VladimirMikulic can you kindly review ? Thanks ✌️

@Tlazypanda
Copy link
Collaborator Author

@jywarren @cesswairimu can you kindly review? Thanks ✌️

@@ -57,7 +57,7 @@ def update
@password_verification = user_verification_params
@user = current_user
@user = User.find_by(username: params[:id]) if params[:id] && logged_in_as(['admin'])
if @user.valid_password?(user_verification_params["current_password"]) || user_verification_params["ui_update"].nil?
if @user.valid_password?(user_verification_params["current_password"]) || user_verification_params["ui_update"].nil? || (user_verification_params["current_password"].blank? && user_verification_params["password"].blank? && user_verification_params["password_confirmation"].blank?)
# correct password
Copy link
Member

Choose a reason for hiding this comment

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

Kindly change this comment

@SidharthBansal
Copy link
Member

Kindly add corresponding unit-test. Thanks for your work

@Tlazypanda
Copy link
Collaborator Author

@SidharthBansal Updated pr :) Can you kindly review again? Thanks ✌️

@SidharthBansal
Copy link
Member

Thanks

@jywarren jywarren changed the base branch from master to main June 30, 2020 18:07
@stale
Copy link

stale bot commented Oct 7, 2020

Hi 😄, this issue has been automatically marked as stale because it has not had recent activity. Don't worry you can continue to work on this and ask @publiclab/reviewers to add "work in progress" label 🎉 . Otherwise, it will be closed if no further activity occurs in 5 days -- but you can always re-open it if you like! 💯 Thank you for your contributions 🙌 🎈.

@stale stale bot added the stale label Oct 7, 2020
@cesswairimu cesswairimu closed this Oct 7, 2020
@cesswairimu cesswairimu reopened this Oct 7, 2020
@stale stale bot removed the stale label Oct 7, 2020
@jywarren jywarren merged commit adda855 into publiclab:main Oct 7, 2020
@jywarren
Copy link
Member

jywarren commented Oct 7, 2020

Sorry I missed this! All good now!!! Thank you!!!

shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
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.

Profile picture can be updated without entering password but bio cant be added
5 participants