Kalenderterror
This commit is contained in:
parent
8b623a823c
commit
ebf16af83f
|
|
@ -133,58 +133,60 @@ def getICSFileAll(request, ag):
|
||||||
|
|
||||||
|
|
||||||
def getICSFileEx(request, code, ag):
|
def getICSFileEx(request, code, ag):
|
||||||
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)
|
absencedays = Absence.objects.filter(agency=ag)
|
||||||
for ab in absencedays:
|
for ab in absencedays:
|
||||||
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 = ""
|
print("AG NICHT GEFUNDEN!")
|
||||||
response = HttpResponse()
|
|
||||||
response.status_code = 401
|
|
||||||
return response
|
|
||||||
except:
|
|
||||||
realm = ""
|
realm = ""
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
response.status_code = 401
|
response.status_code = 401
|
||||||
return response
|
return response
|
||||||
|
#except:
|
||||||
|
# realm = ""
|
||||||
|
# response = HttpResponse()
|
||||||
|
# response.status_code = 401
|
||||||
|
# return response
|
||||||
|
|
||||||
|
|
||||||
def getICSFileExAll(request, code, ag):
|
def getICSFileExAll(request, code, ag):
|
||||||
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_all:
|
if agency != None and agency.agencycal_publicstatus == 1 and code == agency.agencycalurl_all:
|
||||||
c = Calendar()
|
c = Calendar()
|
||||||
absencedays = Absence.objects.filter(agency=ag)
|
absencedays = Absence.objects.filter(agency=ag)
|
||||||
for ab in absencedays:
|
for ab in absencedays:
|
||||||
e = Event()
|
e = Event()
|
||||||
e.name = ab.user.first_name + " " + ab.user.last_name + " | " + ab.reason.name
|
e.name = ab.user.first_name + " " + ab.user.last_name + " | " + ab.reason.name
|
||||||
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 = ""
|
print("AG NICHT GEFUNDEN!")
|
||||||
response = HttpResponse()
|
|
||||||
response.status_code = 401
|
|
||||||
return response
|
|
||||||
except:
|
|
||||||
realm = ""
|
realm = ""
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
response.status_code = 401
|
response.status_code = 401
|
||||||
return response
|
return response
|
||||||
|
#except:
|
||||||
|
# realm = ""
|
||||||
|
# response = HttpResponse()
|
||||||
|
# response.status_code = 401
|
||||||
|
# return response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue