def post(self, request, *args, **kwargs):
service_code = request.data['<STR_LIT>']<EOL>if service_code not in SERVICES.keys():<EOL><INDENT>return Response({ '<STR_LIT>': _('<STR_LIT>') }, status=<NUM_LIT>)<EOL><DEDENT>serializers = {<EOL>'<STR_LIT>': NodeRequestSerializer,<EOL>'<STR_LIT>': VoteRequestSerializer,<EOL>'<STR_LIT>': CommentRequestSerializer,<EOL>'<STR_LIT>': RatingRequestSerializer,<EOL>}<EOL>kwargs['<STR_LIT>'] = service_code<EOL>kwargs['<STR_LIT>'] = serializers[service_code]<EOL>user=self.get_custom_data()<EOL>request.UPDATED = request.data.copy()<EOL>request.UPDATED['<STR_LIT:user>'] = user['<STR_LIT:user>']<EOL>if service_code == '<STR_LIT>':<EOL><INDENT>for checkPOSTdata in ('<STR_LIT>','<STR_LIT:name>','<STR_LIT>','<STR_LIT>'):<EOL><INDENT>if checkPOSTdata not in request.data.keys():<EOL><INDENT>return Response({ '<STR_LIT>': _('<STR_LIT>') }, status=<NUM_LIT>)<EOL><DEDENT>else:<EOL><INDENT>if not request.data[checkPOSTdata] :<EOL><INDENT>return Response({ '<STR_LIT>': _('<STR_LIT>') }, status=<NUM_LIT>)<EOL><DEDENT><DEDENT><DEDENT>layer = Layer.objects.get(slug=request.UPDATED['<STR_LIT>'])<EOL>request.UPDATED['<STR_LIT>'] = layer.id<EOL>lat = float(request.UPDATED['<STR_LIT>'])<EOL>long = float(request.UPDATED['<STR_LIT>'])<EOL>point = Point((long, lat))<EOL>request.UPDATED['<STR_LIT>'] = point.wkt<EOL>request.UPDATED['<STR_LIT>'] = slugify(request.UPDATED['<STR_LIT:name>'])<EOL><DEDENT>return self.create(request, *args, **kwargs)<EOL>
Post a service request (requires authentication)