Commit 776650095e28d27b4cac9081d795cd33bc8194f5
Committed by
Luciano Prestes
1 parent
aa448d05
Exists in
master
and in
79 other branches
Mount and send url to complete software registration
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
lib/create_software.rb
1 | 1 | class CreateSoftware < Task |
2 | + include Rails.application.routes.url_helpers | |
2 | 3 | |
3 | 4 | validates_presence_of :requestor_id, :target_id |
4 | 5 | validates_presence_of :name |
... | ... | @@ -79,9 +80,15 @@ class CreateSoftware < Task |
79 | 80 | end |
80 | 81 | |
81 | 82 | def task_finished_message |
82 | - _('Your request for registering the software "%{software}" was approved. You can access %{environment} now and start using your new software.') % { :software => self.name, :environment => self.environment } | |
83 | + _('Your request for registering the software "%{software}" was approved. You can access %{url} and finish the registration of your software.') % { :software => self.name, :url => mount_url } | |
83 | 84 | end |
84 | 85 | |
85 | 86 | private |
86 | 87 | |
88 | + def mount_url | |
89 | + identifier = Community.where(:name => self.name).first.identifier | |
90 | + # The use of url_for doesn't allow the /social within the Public Software portal. That's why the url is mounted so 'hard coded' | |
91 | + url = "#{environment.top_url}/myprofile/#{identifier}/profile_editor/edit" | |
92 | + end | |
93 | + | |
87 | 94 | end | ... | ... |