Archivierte Dateien werden schreibgesperrt
This commit is contained in:
parent
fb3f77a37a
commit
ac3c16633c
8
users.py
8
users.py
@ -3,6 +3,7 @@ import hashlib
|
|||||||
# User bezogene Funktionen
|
# User bezogene Funktionen
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
from stat import S_IREAD, S_IWUSR
|
||||||
import datetime
|
import datetime
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
@ -230,11 +231,14 @@ class user:
|
|||||||
data["archived"] = 1
|
data["archived"] = 1
|
||||||
data["overtime"] = overtime
|
data["overtime"] = overtime
|
||||||
|
|
||||||
json_dict = json.dumps(data)
|
json_dict = json.dumps(data, indent=4)
|
||||||
|
|
||||||
with open(filename, "w") as outputfile:
|
with open(filename, "w") as outputfile:
|
||||||
outputfile.write(json_dict)
|
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):
|
def get_last_months_overtime(self, year, month):
|
||||||
try:
|
try:
|
||||||
if int(month) == 1:
|
if int(month) == 1:
|
||||||
|
@ -1,12 +1 @@
|
|||||||
{
|
{"archived": 1, "overtime": -860821, "absence": {"7": "U", "8": "K", "9": "KK", "10": "UU", "11": "F", "14": "EZ"}}
|
||||||
"archived": 0,
|
|
||||||
"overtime": 0,
|
|
||||||
"absence": {
|
|
||||||
"7": "U",
|
|
||||||
"8": "K",
|
|
||||||
"9": "KK",
|
|
||||||
"10": "UU",
|
|
||||||
"11": "F",
|
|
||||||
"14": "EZ"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user