Archivierte Dateien werden schreibgesperrt

This commit is contained in:
Alexander Malzkuhn 2025-05-13 14:21:36 +02:00
parent fb3f77a37a
commit ac3c16633c
2 changed files with 7 additions and 14 deletions

View File

@ -3,6 +3,7 @@ import hashlib
# User bezogene Funktionen
import os
from stat import S_IREAD, S_IWUSR
import datetime
import time
import json
@ -230,11 +231,14 @@ class user:
data["archived"] = 1
data["overtime"] = overtime
json_dict = json.dumps(data)
json_dict = json.dumps(data, indent=4)
with open(filename, "w") as outputfile:
outputfile.write(json_dict)
# Dateien auf readonly setzen
os.chmod(filename, S_IREAD)
filename_txt = f"{self.userfolder}/{year}-{month}.txt"
os.chmod(filename_txt, S_IREAD)
def get_last_months_overtime(self, year, month):
try:
if int(month) == 1:

View File

@ -1,12 +1 @@
{
"archived": 0,
"overtime": 0,
"absence": {
"7": "U",
"8": "K",
"9": "KK",
"10": "UU",
"11": "F",
"14": "EZ"
}
}
{"archived": 1, "overtime": -860821, "absence": {"7": "U", "8": "K", "9": "KK", "10": "UU", "11": "F", "14": "EZ"}}