@@ -98,7 +98,8 @@ def create
9898 FeatureFlag . raise_unless_enabled! ( :diego_cnb ) if lifecycle . type == VCAP ::CloudController ::Lifecycles ::CNB
9999 unprocessable! ( lifecycle . errors . full_messages ) unless lifecycle . valid?
100100
101- app = AppCreate . new ( user_audit_info ) . create ( message , lifecycle )
101+ app_creator = AppCreate . new ( user_audit_info )
102+ app = app_creator . create ( message , lifecycle )
102103 TelemetryLogger . v3_emit (
103104 'create-app' ,
104105 {
@@ -107,7 +108,7 @@ def create
107108 }
108109 )
109110
110- add_warning_headers ( app . stack_warnings ) if app . stack_warnings &.any?
111+ add_warning_headers ( app_creator . warnings ) if app_creator . warnings &.any?
111112
112113 render status : :created , json : Presenters ::V3 ::AppPresenter . new ( app )
113114 rescue AppCreate ::InvalidApp => e
@@ -127,7 +128,8 @@ def update
127128 lifecycle = AppLifecycleProvider . provide_for_update ( message , app )
128129 unprocessable! ( lifecycle . errors . full_messages ) unless lifecycle . valid?
129130
130- app = AppUpdate . new ( user_audit_info ) . update ( app , message , lifecycle )
131+ app_updater = AppUpdate . new ( user_audit_info )
132+ app = app_updater . update ( app , message , lifecycle )
131133 TelemetryLogger . v3_emit (
132134 'update-app' ,
133135 {
@@ -136,7 +138,7 @@ def update
136138 }
137139 )
138140
139- add_warning_headers ( app . stack_warnings ) if app . stack_warnings &.any?
141+ add_warning_headers ( app_updater . warnings ) if app_updater . warnings &.any?
140142
141143 render status : :ok , json : Presenters ::V3 ::AppPresenter . new ( app )
142144 rescue AppUpdate ::DropletNotFound
0 commit comments