[issue #578] Fixed error handling in PresonalRepository.
This commit is contained in:
parent
606609dea6
commit
6f4f48cbce
|
@ -12,7 +12,7 @@ class Admin::UsersController < Admin::BaseController
|
|||
def create
|
||||
@user.role = params[:role]
|
||||
@user.confirmed_at = Time.now.utc
|
||||
if @user.save
|
||||
if (@user.save rescue false)
|
||||
flash[:notice] = t('flash.user.saved')
|
||||
redirect_to admin_users_path
|
||||
else
|
||||
|
|
|
@ -9,19 +9,25 @@ module Modules
|
|||
end
|
||||
|
||||
def create_personal_repository
|
||||
pl = own_platforms.build
|
||||
pl.owner = self
|
||||
pl.name = "#{self.uname}_personal"
|
||||
pl.description = "#{self.uname}_personal"
|
||||
pl.platform_type = 'personal'
|
||||
pl.distrib_type = APP_CONFIG['distr_types'].first
|
||||
pl.visibility = 'open'
|
||||
pl.save!
|
||||
begin
|
||||
pl = own_platforms.build
|
||||
pl.owner = self
|
||||
pl.name = "#{self.uname}_personal"
|
||||
pl.description = "#{self.uname}_personal"
|
||||
pl.platform_type = 'personal'
|
||||
pl.distrib_type = APP_CONFIG['distr_types'].first
|
||||
pl.visibility = 'open'
|
||||
pl.save!
|
||||
|
||||
rep = pl.repositories.build
|
||||
rep.name = 'main'
|
||||
rep.description = 'main'
|
||||
rep.save!
|
||||
rep = pl.repositories.build
|
||||
rep.name = 'main'
|
||||
rep.description = 'main'
|
||||
rep.save!
|
||||
rescue Exception => e
|
||||
pl.now_destroy rescue false
|
||||
raise e
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
def personal_platform
|
||||
|
|
Loading…
Reference in New Issue