Skip to content
Snippets Groups Projects
Commit 1793976d authored by Karan Rajanayagam's avatar Karan Rajanayagam
Browse files

Merge branch 'TOAMS_saksansvarlig_only_created_sak' into 'master'

Toams saksansvarlig only created sak

See merge request !25
parents 989cd669 0ab97cc7
No related branches found
No related tags found
1 merge request!25Toams saksansvarlig only created sak
Pipeline #121463 passed with stage
in 59 seconds
......@@ -74,7 +74,6 @@ class EphClient:
def _build_soap_service(
config: typing.Optional[EphSoapService],
cache_wsdl: CacheWsdl,
) -> typing.Tuple[
typing.Optional[zeep.client.Client], typing.Optional[zeep.proxy.ServiceProxy]
]:
......@@ -87,8 +86,10 @@ class EphClient:
transport = zeep.transports.Transport(session=session)
if cache_wsdl and cache_wsdl.enabled:
transport.cache = SqliteCache(path=cache_wsdl.path, timeout=cache_wsdl.timeout)
logger.info(f"Using cache, path: {cache_wsdl.path}, timeout: {cache_wsdl.timeout}")
transport.cache = SqliteCache(
path=cache_wsdl.path, timeout=cache_wsdl.timeout
)
logger.info(f"Using cache, configs: {cache_wsdl}")
settings = zeep.Settings(extra_http_headers=config.headers)
client = zeep.Client(settings=settings, wsdl=config.wsdl, transport=transport)
......@@ -323,7 +324,9 @@ class EphClient:
# jp.TilgangskodeId = ""
jp.SaksbehandlerId = self.config.def_saksbehandler_pn_id
sak.SaksansvarligPersonId = self.config.def_saksbehandler_pn_id
if not req.sak_id: # only assign saksbehandler for created sak
sak.SaksansvarligPersonId = self.config.def_saksbehandler_pn_id
jp.attr__Id = None
sak.attr__Id = None
......@@ -506,7 +509,7 @@ class EphClient:
# empty enhet query for uit
enhet_query = f"AND SaksansvarligEnhetId ='{search.adm_enh_id}'"
ord_verdi_query = f"AND {prinsipp_name}.OrdningsverdiId = '{search.ord_verdi_id}'"
ord_verdi_query = f"{prinsipp_name}.OrdningsverdiId = '{search.ord_verdi_id}'"
if "uit" in self.config.interface:
enhet_query = ""
......@@ -516,7 +519,7 @@ class EphClient:
"{} "
"AND SaksstatusId != '{}' AND SaksstatusId != '{}' "
"AND {}.OrdningsprinsippId = '{}' "
"{}".format(
"AND {}".format(
self.escape_filtered_query(title),
enhet_query,
search.status_avsluttet,
......@@ -611,7 +614,9 @@ class EphClient:
return req.sek_klassering.ordnings_verdi_id
elif prinsipp == PrinsippType.arkuit.value:
if not self.config.sak_config.primaer_ordningsprinsipp_id:
raise ValueError("Required config: <primaer_ordningsprinsipp_id> is missing")
raise ValueError(
"Required config: <primaer_ordningsprinsipp_id> is missing"
)
return self.config.sak_config.primaer_ordningsprinsipp_id
else:
raise ValueError(f"Invalid {prefix}prinsipp: {prinsipp}")
......@@ -623,7 +628,9 @@ class EphClient:
return req.sek_klassering.beskrivelse
elif prinsipp == PrinsippType.arkuit.value:
if not self.config.sak_config.primaer_ordningsprinsipp_value:
raise ValueError("Required config: <primaer_ordningsprinsipp_value> is missing")
raise ValueError(
"Required config: <primaer_ordningsprinsipp_value> is missing"
)
return self.config.sak_config.primaer_ordningsprinsipp_value
else:
raise ValueError(f"Invalid {prefix}prinsipp: {prinsipp}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment