Kalender
This commit is contained in:
parent
a7a45ca972
commit
bcde49c876
|
|
@ -939,6 +939,7 @@ def TimeAjax(request):
|
||||||
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("__")
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ 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:
|
||||||
|
|
@ -147,7 +147,7 @@ def getICSFileEx(request, code, ag):
|
||||||
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:
|
||||||
|
|
@ -155,11 +155,11 @@ def getICSFileEx(request, code, ag):
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
response.status_code = 400
|
response.status_code = 400
|
||||||
return response
|
return response
|
||||||
except:
|
#except:
|
||||||
realm = ""
|
# realm = ""
|
||||||
response = HttpResponse()
|
# response = HttpResponse()
|
||||||
response.status_code = 403
|
# response.status_code = 403
|
||||||
return response
|
# return response
|
||||||
else:
|
else:
|
||||||
realm = ""
|
realm = ""
|
||||||
response = HttpResponse()
|
response = HttpResponse()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue