Commit ea3578f2cc4fa476734325f9555377f9bb97238c
1 parent
5e746850
Exists in
master
and in
29 other branches
ActionItem135: refactoring: extracting redirect to user initial page to a new method
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1163 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
app/controllers/public/account_controller.rb
@@ -21,7 +21,7 @@ class AccountController < PublicController | @@ -21,7 +21,7 @@ class AccountController < PublicController | ||
21 | self.current_user.remember_me | 21 | self.current_user.remember_me |
22 | cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } | 22 | cookies[:auth_token] = { :value => self.current_user.remember_token , :expires => self.current_user.remember_token_expires_at } |
23 | end | 23 | end |
24 | - redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) | 24 | + go_to_user_initial_page |
25 | flash[:notice] = _("Logged in successfully") | 25 | flash[:notice] = _("Logged in successfully") |
26 | else | 26 | else |
27 | flash[:notice] = _('Incorrect username or password') | 27 | flash[:notice] = _('Incorrect username or password') |
@@ -42,7 +42,7 @@ class AccountController < PublicController | @@ -42,7 +42,7 @@ class AccountController < PublicController | ||
42 | self.current_user = @user | 42 | self.current_user = @user |
43 | owner_role = Role.find_by_name('owner') | 43 | owner_role = Role.find_by_name('owner') |
44 | @user.person.affiliate(@user.person, [owner_role]) if owner_role | 44 | @user.person.affiliate(@user.person, [owner_role]) if owner_role |
45 | - redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) | 45 | + go_to_user_initial_page |
46 | flash[:notice] = _("Thanks for signing up!") | 46 | flash[:notice] = _("Thanks for signing up!") |
47 | end | 47 | end |
48 | rescue ActiveRecord::RecordInvalid | 48 | rescue ActiveRecord::RecordInvalid |
@@ -126,4 +126,9 @@ class AccountController < PublicController | @@ -126,4 +126,9 @@ class AccountController < PublicController | ||
126 | def load_default_environment | 126 | def load_default_environment |
127 | @environment = Environment.default | 127 | @environment = Environment.default |
128 | end | 128 | end |
129 | + | ||
130 | + def go_to_user_initial_page | ||
131 | + redirect_back_or_default(myprofile_path(:controller => 'profile_editor', :profile => current_user.login)) | ||
132 | + end | ||
133 | + | ||
129 | end | 134 | end |