diff --git a/Gemfile.lock b/Gemfile.lock index 9ce63c45..877fa476 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -282,7 +282,7 @@ GEM httparty (~> 0.13.7) json rack - rb-readline (0.5.4) + rb-readline (0.5.5) rdoc (4.2.1) json (~> 1.4) recaptcha (4.0.1) diff --git a/app/controllers/camps_controller.rb b/app/controllers/camps_controller.rb index 50a45ddb..77108c73 100644 --- a/app/controllers/camps_controller.rb +++ b/app/controllers/camps_controller.rb @@ -338,12 +338,16 @@ def enforce_grant_lockdown! def create_camp Camp.transaction do - @camp.save! - if Rails.application.config.x.firestarter_settings['google_drive_integration'] and ENV['GOOGLE_APPS_SCRIPT'].present? - response = NewDreamAppsScript::createNewDreamFolder(@camp.creator.email, @camp.id, @camp.name) - @camp.google_drive_folder_path = response['id'] - @camp.google_drive_budget_file_path = response['budget'] + begin @camp.save! + if Rails.application.config.x.firestarter_settings['google_drive_integration'] and ENV['GOOGLE_APPS_SCRIPT'].present? + response = NewDreamAppsScript::createNewDreamFolder(@camp.creator.email, @camp.id, @camp.name) + @camp.google_drive_folder_path = response['id'] + @camp.google_drive_budget_file_path = response['budget'] + @camp.save! + end + rescue + flash[:alert] = "#{t:failed_to_create_google_drive_integration}" end end true diff --git a/config/locales/en.yml b/config/locales/en.yml index 153bf379..05c8d10c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -453,6 +453,7 @@ en: i_gift_thee_grants: Donate to dream i_gift_thee_grants_diabled: "Thank you for your participation. You have donated all your hearts." no_granting_yet: No granting for this dream yet! + failed_to_create_google_drive_integration: Failed to create google drive budget document donate_title: Oh Wow! this thing you are about to do... donate_content: There are many ways to help a dream come true, yet here you are invited to divide your Hearts donation and give it to this dream. diff --git a/config/locales/he.yml b/config/locales/he.yml index b97c8de1..a5c67662 100755 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -385,6 +385,7 @@ he: i_gift_thee_grants: "תרמו לחלום" i_gift_thee_grants_diabled: "תודה על ההשתתפות. תרמת את כל הלבבות שלך" no_granting_yet: "טרם נפתח המענק לחלום זה!" + failed_to_create_google_drive_integration: "נכשלנו בניסיון ליצור קובץ תקציב בדרייב. יתוקן בקרוב" donate_title: "הו, וואו! הדבר שאתם עומדים לעשות..." donate_content: "תרומה לחלום יכולה לבוא בכל מיני צורות, אבל מכאן תוכלו להעביר חלק מעלות התרומה (שכבר שילמתם), ולבקש לתרום אותה לחלום הזה." donate_text: "תרמו"