5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 20:21:42 +00:00

fix: el rol todavía no está guardado

(cherry picked from commit ee10e170ec)
This commit is contained in:
f 2024-02-28 15:01:36 -03:00 committed by Sutty
parent cba395473c
commit d0bd90ab4e

View file

@ -13,7 +13,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
def create
self.site = Site.new params
add_role temporal: false, rol: 'usuarie'
role = add_role temporal: false, rol: 'usuarie'
site.deploys.build type: 'DeployLocal'
# Los sitios de testing no se sincronizan
sync_nodes unless site.name.end_with? '.testing'
@ -26,7 +26,7 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
# que no haya estados intermedios.
site.locales = [usuarie.lang]
add_role_to_deploys!
add_role_to_deploys! role
site.save &&
site.config.write &&
@ -247,9 +247,9 @@ SiteService = Struct.new(:site, :usuarie, :params, keyword_init: true) do
private
# Asignar un rol a cada deploy si no lo tenía ya
def add_role_to_deploys!
def add_role_to_deploys!(role = current_role)
site.deploys.each do |deploy|
deploy.rol ||= current_role
deploy.rol ||= role
end
end