Bugfixes, Daten umgezogen
This commit is contained in:
@@ -44,17 +44,15 @@ def event_api( request, username = None, eventId = None ):
|
||||
serializer = ParticipationSerializer ( participationQs, data = request.DATA, many=True )
|
||||
if serializer.is_valid():
|
||||
for serializedObject in serializer.object:
|
||||
if not EventParticipation.isMember( request.user ):
|
||||
if not ( EventParticipation.isMember( request.user ) or EventParticipation.isAdmin( request.user ) ):
|
||||
return Response( status = status.HTTP_403_FORBIDDEN )
|
||||
if serializedObject.user != request.user:
|
||||
if not EventParticipation.isAdmin( request.user ):
|
||||
return Response( status = status.HTTP_403_FORBIDDEN )
|
||||
|
||||
print serializer.data
|
||||
serializer.save()
|
||||
return Response( serializer.data )
|
||||
else:
|
||||
print "In Bad request" + str(serializer.errors)
|
||||
return Response( status = status.HTTP_400_BAD_REQUEST )
|
||||
|
||||
|
||||
@@ -67,7 +65,6 @@ def eventplanning( request ):
|
||||
"""
|
||||
# non-members see the grid - but cannot edit anything
|
||||
if not EventParticipation.isMember( request.user ):
|
||||
print "Not a member"
|
||||
return events_grid(request)
|
||||
|
||||
# All events in the future sorted by date
|
||||
|
||||
Reference in New Issue
Block a user