This commit is contained in:
holger.trampe 2021-01-29 17:10:48 +01:00
parent 2995ab3240
commit 3d34066b15
1 changed files with 14 additions and 16 deletions

View File

@ -137,18 +137,11 @@ def getICSFileEx(request, code, ag):
#try:
agency = Agency.objects.get(pk=ag)
send_mail(
'KAL INFO',
str(agency.pk) + " " + str(agency.agencycal_publicstatus),
'noreply@digitale-agentur.com',
["htrampe@gmail.com"],
fail_silently=True
)
if agency != None and agency.agencycal_publicstatus == 1 and code == agency.agencycalurl:
c = Calendar()
absencedays = Absence.objects.filter(agency=ag).exclude(confirm_status=2)
for ab in absencedays:
try:
if ab.start != None and ab.end != None:
e = Event()
e.name = ab.user.first_name + " " + ab.user.last_name + " abwesend "
@ -157,6 +150,11 @@ def getICSFileEx(request, code, ag):
e.end = ab.end
#e.allday = True
c.events.add(e)
except:
realm = ""
response = HttpResponse()
response.status_code = 410
return response
return HttpResponse(c, content_type='text/calendar')
else:
realm = ""