[issue #578] Fixed error handling in PresonalRepository.

This commit is contained in:
George Vinogradov 2012-07-26 01:49:55 +04:00
parent 606609dea6
commit 6f4f48cbce
2 changed files with 19 additions and 13 deletions

View File

@ -12,7 +12,7 @@ class Admin::UsersController < Admin::BaseController
def create def create
@user.role = params[:role] @user.role = params[:role]
@user.confirmed_at = Time.now.utc @user.confirmed_at = Time.now.utc
if @user.save if (@user.save rescue false)
flash[:notice] = t('flash.user.saved') flash[:notice] = t('flash.user.saved')
redirect_to admin_users_path redirect_to admin_users_path
else else

View File

@ -9,6 +9,7 @@ module Modules
end end
def create_personal_repository def create_personal_repository
begin
pl = own_platforms.build pl = own_platforms.build
pl.owner = self pl.owner = self
pl.name = "#{self.uname}_personal" pl.name = "#{self.uname}_personal"
@ -22,6 +23,11 @@ module Modules
rep.name = 'main' rep.name = 'main'
rep.description = 'main' rep.description = 'main'
rep.save! rep.save!
rescue Exception => e
pl.now_destroy rescue false
raise e
end
return true
end end
def personal_platform def personal_platform