#NEWLINE# @ detail_route ( methods = [ 'post' ] ) #NEWLINE# def create_poll( self , request , pk = None ) : #NEWLINE# #INDENT# '\n        View to create a poll. It is a POST request without any data.\n        ' #NEWLINE# motion = self . get_object ( ) #NEWLINE# try : #NEWLINE# #INDENT# with transaction . atomic ( ) : #NEWLINE# #INDENT# motion . create_poll ( ) #NEWLINE# #UNINDENT# #UNINDENT# except WorkflowError as e : #NEWLINE# #INDENT# raise ValidationError ( { #NEWLINE# #INDENT# 'detail' : pk , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return Response ( { #NEWLINE# #INDENT# 'detail' : _ ( 'Vote created successfully.' ) , #NEWLINE# #UNINDENT# } )