From b82d0f6a28f254441821b68f9329ffff07f12491 Mon Sep 17 00:00:00 2001 From: Holger Trampe Date: Sat, 23 Oct 2021 12:05:22 +0200 Subject: [PATCH] Quota leer bei Agentur FIX --- .../__pycache__/counter_tag.cpython-38.pyc | Bin 28766 -> 28730 bytes standards/templatetags/counter_tag.py | 23 ++++++++---------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 52cfaf308d87e045c53816e4fd1ec405562f9c07..7abe1f4f9cfa36cc2f2bdef9408defeb2f30e38c 100644 GIT binary patch delta 88 zcmccjfN|FYM&3|fUM>b8h`v{xn7fg;HI;GRfbre~M&3|fUM>b8xGz(jICCR!YbxWO$&*t}nX2+8pGeJ;31SwB}^XC diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index d704275..c616914 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -1181,20 +1181,17 @@ def getNCDirInfosURL(request, ncid): @register.simple_tag def getAGGroupQuotaData(request): r = requests.request("PROPFIND", settings.NEXTCLOUD_URL + "remote.php/dav/files/" + request.user.username + "/Agenturdaten", headers={'Content-Type' : 'text/xml', 'Authorization' : "Bearer " + request.user.profile.nc_sid}) - try: - # IN USE - split_response = r.text.split("") - inuse = split_response[1].split("")[0] - - # QUOTA - split_response = r.text.split("") - quota = split_response[1].split("")[0] + # IN USE + split_response = r.text.split("") + inuse = split_response[1].split("")[0] + + # QUOTA + split_response = r.text.split("") + quota = split_response[1].split("")[0] - # PERCENT VALUE - percent = (100 / int(quota))*int(inuse) - return [quota, inuse, str(round(percent, 0)).replace(",", ".")] - except: - return [0, 0, 0] + # PERCENT VALUE + percent = (100 / int(quota))*int(inuse) + return [quota, inuse, str(round(percent, 0)).replace(",", ".")]