diff --git a/dump.rdb b/dump.rdb index 4b27a4c..f31bf29 100644 Binary files a/dump.rdb and b/dump.rdb differ diff --git a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc index 1c9dd33..218e5f3 100644 Binary files a/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc and b/standards/templatetags/__pycache__/counter_tag.cpython-38.pyc differ diff --git a/standards/templatetags/counter_tag.py b/standards/templatetags/counter_tag.py index b786593..8ac8e85 100644 --- a/standards/templatetags/counter_tag.py +++ b/standards/templatetags/counter_tag.py @@ -122,12 +122,15 @@ def getLocalWeather(user): agency = user.profile.agency if len(agency.city) > 0: - r = requests.get('http://api.openweathermap.org/data/2.5/weather?q='+agency.city+'&lang=de&units=metric&APPID=e37ac762a3c233f5fbc434c72df7961f') - weatherinfo = r.json() - print(weatherinfo) - weatherinfodata.append("| " + weatherinfo['weather'][0]['description']) - weatherinfodata.append(weatherinfo['weather'][0]['icon']) - weatherinfodata.append(str(weatherinfo['main']['temp']) + " °C") + # Try to request Weather-Info. If request failed, no weatherinfo is showing + try: + r = requests.get('http://api.openweathermap.org/data/2.5/weather?q='+agency.city+'&lang=de&units=metric&APPID=e37ac762a3c233f5fbc434c72df7961f') + weatherinfo = r.json() + weatherinfodata.append("| " + weatherinfo['weather'][0]['description']) + weatherinfodata.append(weatherinfo['weather'][0]['icon']) + weatherinfodata.append(str(weatherinfo['main']['temp']) + " °C") + except: + weatherinfodata = "" else: weatherinfodata = "" @@ -950,4 +953,25 @@ def getBaseURLIcsLink(agency): return settings.BASE_URL + "ics/" + str(agency.pk) +@register.simple_tag +def getBaseURLIcsLinkAll(agency): + return settings.BASE_URL + "icsall/" + str(agency.pk) + +@register.simple_tag +def getBaseURLIcsEx(agency): + return settings.BASE_URL + "icspublic/" + str(agency.agencycalurl) + "/" + str(agency.pk) + +@register.simple_tag +def getBaseURLIcsExAll(agency): + return settings.BASE_URL + "icspublicall/" + str(agency.agencycalurl_all) + "/" + str(agency.pk) + + + + + + + + + + diff --git a/timemanagement/templates/timemanagement/tm_ab_management.html b/timemanagement/templates/timemanagement/tm_ab_management.html index 06e562c..d9f5526 100644 --- a/timemanagement/templates/timemanagement/tm_ab_management.html +++ b/timemanagement/templates/timemanagement/tm_ab_management.html @@ -197,20 +197,48 @@
{{weatherdata.2}}
{% endif %}