Skip to content

Commit

Permalink
Merge branch 'ontoportal-lirmm-upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
jvendetti committed Nov 12, 2021
2 parents ad0e878 + 2de025e commit 2ffd3c8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def update
render action: "edit"
else
flash[:notice] = 'Account was successfully updated'
#TODO test if not same users to update

if session[:user].username == @user.username
session[:user].update_from_params(user_params)
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/users/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@
= submit_tag "Update", :class=>"greenbtn btn btn-outline-secondary btn-sm "
\    
- unless params[:password].eql?("true")
= link_to "Change Password", edit_user_path(CGI.escape(@user.username), password: true)
= link_to "Change Password", edit_user_path(@user.username, password: true)
-# use @user.username unstead of sessions
%br/
4 changes: 2 additions & 2 deletions app/views/users/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
%th Account Name:
%td= @user.username
%tr
%td{colspan: "2", style: "text-align: right;"}
%a{href: "/accounts/#{CGI.escape(@user.username)}/edit"} Edit Information
%td{:colspan => "2", :style => "text-align: right;"}
= link_to "Edit Information", "/accounts/#{CGI.escape(@user.username)}/edit"
%br/
%span{style: "font-size: large; font-weight: bold;"}
API Key
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

resources :projects, constraints: { id: /[^\/]+/ }

resources :users, path: :accounts, requirements: { id: /.+/ }, constraints: { id: /[0-z\.\-\%]+/ }
resources :users, path: :accounts, constraints: { id: /[\d\w\.\-\%\+ ]+/ }

resources :reviews

Expand Down Expand Up @@ -104,7 +104,7 @@
get '/lost_pass' => 'login#lost_password'
get '/reset_password' => 'login#reset_password'
post '/accounts/:id/custom_ontologies' => 'users#custom_ontologies', :as => :custom_ontologies
get '/login_as/:login_as' => 'login#login_as' , constraints: { login_as: /[0-z\.]+/ }
get '/login_as/:login_as' => 'login#login_as' , constraints: { login_as: /[\d\w\.\-\%\+ ]+/ }
post '/login/send_pass', to: 'login#send_pass'

# History
Expand Down

0 comments on commit 2ffd3c8

Please sign in to comment.