Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/2.024.36'
Browse files Browse the repository at this point in the history
  • Loading branch information
JacquelineMorrissette committed Jan 7, 2025
2 parents 522a775 + e4a645f commit b59d95a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion kpi/deployment_backends/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from .backends import DEPLOYMENT_BACKENDS
from .base_backend import BaseDeploymentBackend
from .kc_access.utils import kc_transaction_atomic


class DeployableMixin:
Expand All @@ -29,7 +30,8 @@ def can_be_deployed(self):

def connect_deployment(self, backend: str, **kwargs):
deployment_backend = self.__get_deployment_backend(backend)
deployment_backend.connect(**kwargs)
with kc_transaction_atomic():
deployment_backend.connect(**kwargs)

def deploy(self, backend=False, active=True):
"""
Expand Down
9 changes: 4 additions & 5 deletions kpi/deployment_backends/openrosa_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,10 @@ def connect(self, active=False):
)
xlsx_file = ContentFile(xlsx_io.read(), name=f'{self.asset.uid}.xlsx')

with kc_transaction_atomic():
self._xform = publish_xls_form(xlsx_file, self.asset.owner)
self._xform.downloadable = active
self._xform.kpi_asset_uid = self.asset.uid
self._xform.save(update_fields=['downloadable', 'kpi_asset_uid'])
self._xform = publish_xls_form(xlsx_file, self.asset.owner)
self._xform.downloadable = active
self._xform.kpi_asset_uid = self.asset.uid
self._xform.save(update_fields=['downloadable', 'kpi_asset_uid'])

self.store_data(
{
Expand Down

0 comments on commit b59d95a

Please sign in to comment.