fix(data): standardize month formatting to two digits
Updated the month keys in the `finances.json` file to use a two-digit format. Adjusted the `get_transparency_data` function to accommodate this change by zero-padding single-digit months. This ensures consistency in data representation and prevents potential errors in handling financial data.
This commit is contained in:
parent
2ce269136f
commit
cabb095028
2 changed files with 17 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"2024": {
|
"2024": {
|
||||||
"4": {
|
"04": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 365
|
"EUR": 365
|
||||||
},
|
},
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
"Notes": "Administrative fee for the formation of the association"
|
"Notes": "Administrative fee for the formation of the association"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"5": {
|
"05": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 390
|
"EUR": 390
|
||||||
},
|
},
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"Notes": "Includes setup costs and two monthly payments for new server"
|
"Notes": "Includes setup costs and two monthly payments for new server"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"6": {
|
"06": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 382.42
|
"EUR": 382.42
|
||||||
},
|
},
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
"EUR": -49.05
|
"EUR": -49.05
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"7": {
|
"07": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 422.42
|
"EUR": 422.42
|
||||||
},
|
},
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
"EUR": -264.99
|
"EUR": -264.99
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"8": {
|
"08": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 402.42
|
"EUR": 402.42
|
||||||
},
|
},
|
||||||
|
@ -55,12 +55,20 @@
|
||||||
"EUR": -416.47
|
"EUR": -416.47
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"9": {
|
"09": {
|
||||||
"Membership Fees": {
|
"Membership Fees": {
|
||||||
"EUR": 448.11
|
"EUR": 468.11
|
||||||
},
|
},
|
||||||
"Server Costs": {
|
"Server Costs": {
|
||||||
"EUR": -243.46
|
"EUR": -243.46
|
||||||
|
},
|
||||||
|
"Bank Fees": {
|
||||||
|
"EUR": -53.32
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"Membership Fees": {
|
||||||
|
"EUR": 30.23
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,12 +30,12 @@ def get_transparency_data(data, year=None, month=None, allow_current=False):
|
||||||
month = max(data[year].keys())
|
month = max(data[year].keys())
|
||||||
|
|
||||||
year = str(year)
|
year = str(year)
|
||||||
month = str(month)
|
month = str(month).zfill(2)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not allow_current
|
not allow_current
|
||||||
and year == str(datetime.now().year)
|
and year == str(datetime.now().year)
|
||||||
and month == str(datetime.now().month)
|
and month == str(datetime.now().month).zfill(2)
|
||||||
):
|
):
|
||||||
try:
|
try:
|
||||||
month = max([m for m in data[year].keys() if m != str(datetime.now().month)])
|
month = max([m for m in data[year].keys() if m != str(datetime.now().month)])
|
||||||
|
|
Loading…
Reference in a new issue