From 776650095e28d27b4cac9081d795cd33bc8194f5 Mon Sep 17 00:00:00 2001 From: Parley Martins Date: Wed, 19 Nov 2014 10:40:06 -0200 Subject: [PATCH] Mount and send url to complete software registration --- lib/create_software.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/create_software.rb b/lib/create_software.rb index 516a860..bb952e0 100644 --- a/lib/create_software.rb +++ b/lib/create_software.rb @@ -1,4 +1,5 @@ class CreateSoftware < Task + include Rails.application.routes.url_helpers validates_presence_of :requestor_id, :target_id validates_presence_of :name @@ -79,9 +80,15 @@ class CreateSoftware < Task end def task_finished_message - _('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 } + _('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 } end private + def mount_url + identifier = Community.where(:name => self.name).first.identifier + # 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' + url = "#{environment.top_url}/myprofile/#{identifier}/profile_editor/edit" + end + end -- libgit2 0.21.2