monthly forderungen

This commit is contained in:
2021-02-22 17:23:42 +01:00
parent 04548d428e
commit cf7599c8a9
2 changed files with 60 additions and 1 deletions

View File

@ -1,3 +1,25 @@
#!/usr/bin/python3
print("Monatliche Forderung eintragen")
import requests
import datetime
class ResourceNotFoundException(Exception): pass
def postJson(url):
resp = requests.post(url)
if resp.status_code != 202:
raise ResourceNotFoundException("URL: {}, Code: {}".format(url, resp.status_code))
return resp.json()
BASE_URL = "http://172.16.10.29:5000/hv"
URL_INSERT_FORDERUNGEN = "{base}/forderung/insertAllForMonth"
TEMPLATE_FILE = "inserted.tmpl"
try:
postJson(URL_INSERT_FORDERUNGEN.format(base=BASE_URL))
print("Monatliche Mietforderungen erfolgreich eintragen")
except Exception as e:
print("ERROR: {}".format(e))