Skip to content

Commit

Permalink
Hotfix template
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenHosper committed Dec 13, 2024
1 parent 64086e4 commit 6b6fafe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/bro_upload/templates/move_GMW_Construction.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ns:maintenanceResponsibleParty>{{ sourcedocs_data.maintenanceResponsibleParty }}</ns:maintenanceResponsibleParty>
<ns:wellHeadProtector codeSpace="urn:bro:gmw:WellHeadProtector">{{ sourcedocs_data.wellHeadProtector }}</ns:wellHeadProtector>
<ns:wellConstructionDate>
{% if not sourcedocs_data.wellConstructionDate %}
{% if sourcedocs_data.wellConstructionDate in ['', None, 'Invalid date'] %}
<ns1:date>onbekend</ns1:date>
{% elif sourcedocs_data.wellConstructionDate %}
<ns1:date>{{ sourcedocs_data.wellConstructionDate }}</ns1:date>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<ns:maintenanceResponsibleParty>{{ sourcedocs_data.maintenanceResponsibleParty }}</ns:maintenanceResponsibleParty>
<ns:wellHeadProtector codeSpace="urn:bro:gmw:WellHeadProtector">{{ sourcedocs_data.wellHeadProtector }}</ns:wellHeadProtector>
<ns:wellConstructionDate>
{% if not sourcedocs_data.wellConstructionDate %}
{% if sourcedocs_data.wellConstructionDate in ['', None, 'Invalid date'] %}
<ns1:date>onbekend</ns1:date>
{% elif sourcedocs_data.wellConstructionDate %}
<ns1:date>{{ sourcedocs_data.wellConstructionDate }}</ns1:date>
Expand Down
2 changes: 1 addition & 1 deletion api/bro_upload/templates/replace_GMW_Construction.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ns:maintenanceResponsibleParty>{{ sourcedocs_data.maintenanceResponsibleParty }}</ns:maintenanceResponsibleParty>
<ns:wellHeadProtector codeSpace="urn:bro:gmw:WellHeadProtector">{{ sourcedocs_data.wellHeadProtector }}</ns:wellHeadProtector>
<ns:wellConstructionDate>
{% if not sourcedocs_data.wellConstructionDate %}
{% if sourcedocs_data.wellConstructionDate in ['', None, 'Invalid date'] %}
<ns1:date>onbekend</ns1:date>
{% elif sourcedocs_data.wellConstructionDate %}
<ns1:date>{{ sourcedocs_data.wellConstructionDate }}</ns1:date>
Expand Down
19 changes: 19 additions & 0 deletions api/bro_upload/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import requests
from django.conf import settings

import api.models as api_models

logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -124,3 +126,20 @@ def check_delivery_status(
except requests.RequestException as e:
logger.exception(e)
raise RuntimeError(f"Delivery info check error: {e}")


def include_delivery_responsible_party(
delivery_responsible_party: str, data_owner: str
) -> bool:
"""Check if delivery_responsible_party is equal to data_owner.kvk
If not, than the delivery responsible party should be included in the document.
"""
if not data_owner:
return True

if not delivery_responsible_party:
return False

org = api_models.Organisation.objects.get(uuid=data_owner)
return org.kvk_number != delivery_responsible_party

0 comments on commit 6b6fafe

Please sign in to comment.