Closed GoogleCodeExporter closed 9 years ago
Currently fixed in an ugly way in plapp/views.py, see below. Apparently I was
using the wrong way to check whether an object exists, perhaps still coming
from the old App Engine code. Need to put this into a nice patch.
from django.core.exceptions import ObjectDoesNotExist
def _get_appointment_or_404(request):
if request.method == 'POST':
params = request.POST
else:
params = request.GET
if not 'id' in params:
raise http.Http404
try:
appointment = models.Appointment.objects.all().get(id=int(params['id']))
if not appointment or not appointment.visible:
raise http.Http404
except ObjectDoesNotExist:
raise http.Http404
user = plauth.models.User.get_signed_in(request)
if not user:
raise exceptions.PermissionDenied
try:
invitee = models.Invitee.objects.all().get(appointment=appointment, user=user)
if not invitee:
raise http.Http404
except ObjectDoesNotExist:
raise http.Http404
return (appointment, user, invitee)
Original comment by sander.d...@gmail.com
on 23 Mar 2011 at 1:06
To be fixed with this commit:
https://github.com/sander/pleft/commit/c602b553dd37b057f8ecd75b8732a795447ec113
Original comment by sander.d...@gmail.com
on 13 Nov 2011 at 8:21
Fixed in http://tryout.pleft.com/
Original comment by sander.d...@gmail.com
on 27 Nov 2011 at 4:06
Original issue reported on code.google.com by
sander.d...@gmail.com
on 13 Mar 2011 at 5:36