Kalender
This commit is contained in:
parent
a7a45ca972
commit
bcde49c876
|
|
@ -937,8 +937,9 @@ def TimeAjax(request):
|
|||
usertimedata = UserTime.objects.get(user=user)
|
||||
today = date.today()
|
||||
if(user.profile.agency == request.user.profile.agency):
|
||||
|
||||
|
||||
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]))
|
||||
|
||||
end_day = request.GET["enddate"].split("__")
|
||||
|
|
|
|||
|
|
@ -134,32 +134,32 @@ def getICSFileAll(request, ag):
|
|||
|
||||
def getICSFileEx(request, code, ag):
|
||||
if(request.method == "GET"):
|
||||
try:
|
||||
agency = Agency.objects.get(pk=ag)
|
||||
#try:
|
||||
agency = Agency.objects.get(pk=ag)
|
||||
|
||||
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:
|
||||
if ab.start != None and ab.end != None:
|
||||
e = Event()
|
||||
e.name = ab.user.first_name + " " + ab.user.last_name + " abwesend "
|
||||
e.uid = "da-ab-" + str(ab.pk)
|
||||
e.begin = ab.start
|
||||
e.end = ab.end
|
||||
e.allday = True
|
||||
c.events.add(e)
|
||||
return HttpResponse(c, content_type='text/calendar')
|
||||
else:
|
||||
realm = ""
|
||||
response = HttpResponse()
|
||||
response.status_code = 400
|
||||
return response
|
||||
except:
|
||||
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:
|
||||
if ab.start != None and ab.end != None:
|
||||
e = Event()
|
||||
e.name = ab.user.first_name + " " + ab.user.last_name + " abwesend "
|
||||
e.uid = "da-ab-" + str(ab.pk)
|
||||
e.begin = ab.start
|
||||
e.end = ab.end
|
||||
#e.allday = True
|
||||
c.events.add(e)
|
||||
return HttpResponse(c, content_type='text/calendar')
|
||||
else:
|
||||
realm = ""
|
||||
response = HttpResponse()
|
||||
response.status_code = 403
|
||||
response.status_code = 400
|
||||
return response
|
||||
#except:
|
||||
# realm = ""
|
||||
# response = HttpResponse()
|
||||
# response.status_code = 403
|
||||
# return response
|
||||
else:
|
||||
realm = ""
|
||||
response = HttpResponse()
|
||||
|
|
|
|||
Loading…
Reference in New Issue