Skip to content
Snippets Groups Projects
Commit 95a817e7 authored by Christoffer Stoll's avatar Christoffer Stoll
Browse files

Merge branch 'development' into 'master'

Misc bug fixes

See merge request !11
parents 34ec3c6d 2ba9501d
No related branches found
No related tags found
2 merge requests!18Master,!11Misc bug fixes
......@@ -6,4 +6,7 @@ class EeaUtils:
@staticmethod
def local_datetime():
now = datetime.now(tz=tzlocal()) # current date and time
return now.strftime("%Y-%m-%dT%H:%M:%S%z")
now_str = now.strftime("%Y-%m-%dT%H:%M:%S%z")
# Correction needed because "%z" gives you timezone offset without colon.
now_str_corr = "{0}:{1}".format(now_str[:-2], now_str[-2:])
return now_str_corr
......@@ -37,7 +37,7 @@ class Exceedancedescription:
# Exceedances
(ET.SubElement(exceedanceDescription_subelm, "{" + Namespaces.aqd + "}exceedance")).text = str(self.exceedances).lower()
(ET.SubElement(exceedanceDescription_subelm, "{" + Namespaces.aqd + "}" + self.excedance_type)).text = str(self.max_value)
(ET.SubElement(exceedanceDescription_subelm, "{" + Namespaces.aqd + "}" + self.excedance_type)).text = str(int(self.max_value)) if self.excedance_type == 'numberExceedances' else str(self.max_value)
if self.exceedancedescription_element == "Adjustment":
deductionAssessmentMethod_elm = ET.SubElement(exceedanceDescription_subelm, "{" + Namespaces.aqd + "}deductionAssessmentMethod")
......
from pydantic import BaseModel
from typing import List
from typing import Optional
class AssessmentRegimeDataModel(BaseModel):
......@@ -21,7 +22,7 @@ class AssessmentRegimeModel(BaseModel):
include: bool
year: int
report: str
zone_id: str
zone_id: Optional[str] = None
pollutant_id: str
exceedance_id: str
data: List[AssessmentRegimeDataModel]
......
......@@ -3,7 +3,7 @@ from flask_jwt_extended import create_access_token
import requests
version_endpoint = Blueprint('version', __name__)
current_version = "3.0.11"
current_version = "3.0.15"
@version_endpoint.route('/api/version', methods=['GET'])
......
......@@ -14,3 +14,4 @@ python-simplexml==0.1.5
pandas==1.5.2
pytz==2022.6
requests==2.31.0
Werkzeug==2.3.6
......@@ -86,6 +86,7 @@ const onDataClick = () => {};
<div v-else-if="p.type == 'lookup'">
<div class="font-bold">{{ p.label }}:</div>
<n-select v-model="obj[p.prop_id]" class="!w-[40rem]" @change="onPollutantChange">
<n-option v-if="p.prop_id == 'zone_id'" value="" label="No zone" />
<n-option v-for="p in options.lookups[p.lookup]" :key="p.value" :value="p.value" :label="p.label" />
</n-select>
</div>
......
......@@ -11,7 +11,7 @@ const pageOptions = (lookups) => ({
{ type: "lookup", label: "Adjustment type", prop_id: "adjustment_type_id", prop: "adjustment_type", required: true, lookup: "adjustment_types", default: null, enableInEdit: true, showInGrid: true },
{ type: "lookup", label: "Reason", prop_id: "reason_id", prop: "reason", required: true, lookup: "reasons", default: null, enableInEdit: true, showInGrid: true },
{ type: "number", label: "Value", prop: "exceedance_value", placeholder: "float: The highest exceedance", required: true, default: null, enableInEdit: true, showInGrid: true },
{ type: "number", label: "Value", prop: "exceedance_value", placeholder: "int if type numberExceednace else float", required: true, default: null, enableInEdit: true, showInGrid: true },
{ type: "checkbox", label: "Has exceedance", prop: "has_exceedance", required: true, default: false, enableInEdit: true, showInGrid: true },
......
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