Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit 580480b

Browse files
author
Søren Howe Gersager
committed
Merge branch 'release/3.7.0' into 'master'
Release 3.7.0 - master See merge request bevillingsplatform/bevillingsplatform!1175
2 parents d67679a + 90b937a commit 580480b

File tree

81 files changed

+14647
-3929
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+14647
-3929
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Build docs:
9494
before_script:
9595
- pip3 install -r backend/requirements-test.txt
9696
- pip3 install -r backend/requirements.txt
97-
- apt-get update && apt-get install npm -y && npm install -g jsdoc
97+
- apt-get update && apt-get install npm -y && npm install -g jsdoc@3.6.3
9898
script:
9999
- sphinx-build docs/source doc-build
100100
artifacts:

NEWS.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Version 3.7.0, 2022-01-10
2+
-------------------------
3+
4+
New in this version:
5+
6+
Features
7+
^^^^^^^^
8+
9+
* Add XML export capabilities to Danmarks Statistik.
10+
111
Version 3.6.4, 2022-01-10
212
-------------------------
313

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.6.4
1+
3.7.0

backend/bevillingsplatform/settings.py

Lines changed: 72 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import os
2222
import configparser
2323
import logging
24+
from collections import OrderedDict
2425

2526
from django.utils.translation import gettext_lazy as _
2627

@@ -92,6 +93,10 @@
9293
"INITIALIZE_DATABASE", fallback=False
9394
)
9495

96+
version_file_path = os.path.join(BASE_DIR, "..", "..", "VERSION")
97+
with open(version_file_path) as v_file:
98+
VERSION = v_file.read()
99+
95100
# Application definition
96101

97102
INSTALLED_APPS = [
@@ -104,7 +109,6 @@
104109
"rest_framework",
105110
"django_extensions",
106111
"django_filters",
107-
"rest_framework_filters",
108112
"simple_history",
109113
"constance",
110114
"constance.backends.database",
@@ -254,7 +258,7 @@
254258

255259
REST_FRAMEWORK = {
256260
"DEFAULT_FILTER_BACKENDS": (
257-
"rest_framework_filters.backends.RestFrameworkFilterBackend",
261+
"django_filters.rest_framework.DjangoFilterBackend",
258262
),
259263
"DEFAULT_PERMISSION_CLASSES": (
260264
"rest_framework.permissions.IsAuthenticated",
@@ -397,6 +401,15 @@
397401
fallback=os.path.join(LOG_DIR, "virk.log"),
398402
),
399403
},
404+
"dst": {
405+
"level": "INFO",
406+
"class": "logging.FileHandler",
407+
"formatter": "verbose",
408+
"filename": settings.get(
409+
"DST_LOG_FILE",
410+
fallback=os.path.join(LOG_DIR, "dst.log"),
411+
),
412+
},
400413
# handler for the django-mailer package.
401414
"mailer": {
402415
"level": "INFO",
@@ -474,6 +487,11 @@
474487
"level": "INFO",
475488
"propagate": True,
476489
},
490+
"bevillingsplatform.dst": {
491+
"handlers": ["dst"],
492+
"level": "INFO",
493+
"propagate": True,
494+
},
477495
# logger for the django-mailer package.
478496
"mailer": {
479497
"handlers": ["mailer"],
@@ -545,9 +563,60 @@
545563
_("Maskin-nummer til PRISME"),
546564
int,
547565
),
566+
# DST settings
567+
"DST_MUNICIPALITY_CODE": (
568+
settings.get("DST_MUNICIPALITY_CODE", fallback="151"),
569+
_("Kommune kode"),
570+
),
571+
"DST_MUNICIPALITY_CVR_NUMBER": (
572+
settings.get("DST_MUNICIPALITY_CVR_NUMBER", fallback="58271713"),
573+
_("Kommune CVR"),
574+
),
575+
"DST_MUNICIPALITY_P_NUMBER": (
576+
settings.get("DST_MUNICIPALITY_P_NUMBER", fallback="1003259972"),
577+
_("Kommune P-nummer"),
578+
),
579+
"DST_PROFESSIONAL_CONTACT": (
580+
settings.get("DST_PROFESSIONAL_CONTACT", fallback="[email protected]"),
581+
_("Faglig Ansvarlig kontakt (Identifier, email)"),
582+
),
583+
"DST_TECHNICAL_CONTACT": (
584+
settings.get("DST_TECHNICAL_CONTACT", fallback="[email protected]"),
585+
_("Teknisk Ansvarlig (Identifier, email)"),
586+
),
587+
"DST_RECEIPT_CONTACT": (
588+
settings.get(
589+
"DST_RECEIPT_CONTACT", fallback="[email protected]"
590+
),
591+
_("Kvitteringsmodtager (Identifier, email)"),
592+
),
548593
}
549594
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
550-
595+
CONSTANCE_CONFIG_FIELDSETS = OrderedDict(
596+
{
597+
"Generelle indstillinger": (
598+
"SBSYS_EMAIL",
599+
"TO_EMAIL_FOR_PAYMENTS",
600+
"DEFAULT_FROM_EMAIL",
601+
"DEFAULT_TEAM_NAME",
602+
),
603+
"Økonomi & Konto indstillinger": (
604+
"ACCOUNT_NUMBER_DEPARTMENT",
605+
"ACCOUNT_NUMBER_KIND",
606+
"ACCOUNT_NUMBER_UNKNOWN",
607+
"PRISM_ORG_UNIT",
608+
"PRISM_MACHINE_NO",
609+
),
610+
"Danmarks Statistik levering indstillinger": (
611+
"DST_MUNICIPALITY_CODE",
612+
"DST_MUNICIPALITY_CVR_NUMBER",
613+
"DST_MUNICIPALITY_P_NUMBER",
614+
"DST_PROFESSIONAL_CONTACT",
615+
"DST_TECHNICAL_CONTACT",
616+
"DST_RECEIPT_CONTACT",
617+
),
618+
}
619+
)
551620

552621
SBSYS_APPROPRIATION_TEMPLATE = "core/html/appropriation_letter.html"
553622
SBSYS_XML_TEMPLATE = "core/xml/os2forms.xml"

backend/bevillingsplatform/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
r"internal_payment_recipients", views.InternalPaymentRecipientViewSet
7373
)
7474
router.register(r"efforts", views.EffortViewSet)
75+
router.register(r"dst_payloads", views.DSTPayloadViewSet)
7576

7677
urlpatterns = [
7778
# These are the SAML2 related URLs. You can change

backend/core/admin.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
AccountAliasMapping,
5252
InternalPaymentRecipient,
5353
ActivityCategory,
54+
DSTPayload,
5455
)
5556
from core.proxies import (
5657
SectionEffortStepProxy,
@@ -529,15 +530,24 @@ class SupplementaryActivityDetailsInline(ClassificationInline):
529530
class SectionAdmin(ClassificationAdmin):
530531
"""Add search field."""
531532

532-
search_fields = ("paragraph", "text")
533+
search_fields = ("paragraph", "text", "dst_code")
533534

534535
list_display = (
535536
"paragraph",
536537
"text",
537538
"list_main_activity_for",
538539
"list_supplementary_activity_for",
540+
"dst_code",
541+
"dst_preventative_measures",
542+
"dst_handicap",
539543
"active",
540544
)
545+
546+
list_filter = (
547+
"dst_preventative_measures",
548+
"dst_handicap",
549+
)
550+
541551
filter_horizontal = ("allowed_for_target_groups", "allowed_for_steps")
542552

543553
inlines = (MainActivityDetailsInline, SupplementaryActivityDetailsInline)
@@ -834,3 +844,10 @@ class ActivityCategoryAdmin(ClassificationAdmin):
834844

835845
list_display = ("category_id", "name")
836846
inlines = [SectionInfoActivityCategoryInline]
847+
848+
849+
@admin.register(DSTPayload)
850+
class DSTPayloadAdmin(ClassificationAdmin):
851+
"""ModelAdmin for DSTPayload."""
852+
853+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version='1.0' encoding='UTF-8' ?><schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:dst="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" version="1.0"><element name="AutID" nillable="true" type="dst:AutIDType"><annotation><documentation /></annotation></element><simpleType name="AutIDType"><restriction base="string"><maxLength value="100" /></restriction></simpleType></schema>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<?xml version='1.0' encoding='UTF-8' ?><schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:dst="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" version="1.0"><element name="AutSubID" nillable="true" type="dst:AutSubIDType"><annotation><documentation /></annotation></element><simpleType name="AutSubIDType"><restriction base="string" /></simpleType></schema>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version='1.0' encoding='UTF-8' ?>
2+
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:dst="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://rep.oio.dk/dst.dk/xml/schemas/2002/06/28/" version="1.0">
3+
<include schemaLocation="DST_AutID.xsd" />
4+
<include schemaLocation="DST_AutSubID.xsd" />
5+
<include schemaLocation="DST_Privilige.xsd" />
6+
<element name="Authorisation" type="dst:AuthorisationType"><annotation><documentation /></annotation></element>
7+
<complexType name="AuthorisationType"><sequence><element minOccurs="0" ref="dst:AutID" /><element minOccurs="0" ref="dst:AutSubID" /><element minOccurs="0" ref="dst:Privilige" /></sequence></complexType></schema>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://rep.oio.dk/dst.dk/xml/schemas/2010/04/16/" targetNamespace="http://rep.oio.dk/dst.dk/xml/schemas/2010/04/16/" elementFormDefault="qualified" attributeFormDefault="unqualified" xml:lang="DA">
3+
<xs:include schemaLocation="DST_DeliveryMetadataNewStructure.xsd"/>
4+
<xs:include schemaLocation="DST_BoernMedHandicapSagStrukturSamling.xsd"/>
5+
<xs:element name="BoernMedHandicapLeveranceL231Struktur" type="BoernMedHandicapLeveranceL231StrukturType"/>
6+
<xs:complexType name="BoernMedHandicapLeveranceL231StrukturType">
7+
<xs:sequence>
8+
<xs:element ref="DeliveryMetadataNewStructure"/>
9+
<xs:element ref="BoernMedHandicapSagStrukturSamling"/>
10+
</xs:sequence>
11+
</xs:complexType>
12+
</xs:schema>

0 commit comments

Comments
 (0)