This commit is contained in:
holger.trampe 2021-01-29 16:46:25 +01:00
parent a7a45ca972
commit bcde49c876
2 changed files with 24 additions and 23 deletions

View File

@ -937,8 +937,9 @@ def TimeAjax(request):
usertimedata = UserTime.objects.get(user=user) usertimedata = UserTime.objects.get(user=user)
today = date.today() today = date.today()
if(user.profile.agency == request.user.profile.agency): if(user.profile.agency == request.user.profile.agency):
start_day = request.GET["startdate"].split("__") start_day = request.GET["startdate"].split("__")
# TASK: Diese Zeile wirft eine Fehler: invalid literal for int() with base 10: 'NaN'
start_day_obj = datetime.date(int(start_day[0]), int(start_day[1]), int(start_day[2])) start_day_obj = datetime.date(int(start_day[0]), int(start_day[1]), int(start_day[2]))
end_day = request.GET["enddate"].split("__") end_day = request.GET["enddate"].split("__")

View File

@ -134,32 +134,32 @@ def getICSFileAll(request, ag):
def getICSFileEx(request, code, ag): def getICSFileEx(request, code, ag):
if(request.method == "GET"): if(request.method == "GET"):
try: #try:
agency = Agency.objects.get(pk=ag) agency = Agency.objects.get(pk=ag)
if agency != None and agency.agencycal_publicstatus == 1 and code == agency.agencycalurl: if agency != None and agency.agencycal_publicstatus == 1 and code == agency.agencycalurl:
c = Calendar() c = Calendar()
absencedays = Absence.objects.filter(agency=ag).exclude(confirm_status=2) absencedays = Absence.objects.filter(agency=ag).exclude(confirm_status=2)
for ab in absencedays: for ab in absencedays:
if ab.start != None and ab.end != None: if ab.start != None and ab.end != None:
e = Event() e = Event()
e.name = ab.user.first_name + " " + ab.user.last_name + " abwesend " e.name = ab.user.first_name + " " + ab.user.last_name + " abwesend "
e.uid = "da-ab-" + str(ab.pk) e.uid = "da-ab-" + str(ab.pk)
e.begin = ab.start e.begin = ab.start
e.end = ab.end e.end = ab.end
e.allday = True #e.allday = True
c.events.add(e) c.events.add(e)
return HttpResponse(c, content_type='text/calendar') return HttpResponse(c, content_type='text/calendar')
else: else:
realm = ""
response = HttpResponse()
response.status_code = 400
return response
except:
realm = "" realm = ""
response = HttpResponse() response = HttpResponse()
response.status_code = 403 response.status_code = 400
return response return response
#except:
# realm = ""
# response = HttpResponse()
# response.status_code = 403
# return response
else: else:
realm = "" realm = ""
response = HttpResponse() response = HttpResponse()