#NEWLINE# @ content #NEWLINE# def POST( self , release_id ) : #NEWLINE# #INDENT# 'Create role for release\n\n        :http:\n            * 201 (object successfully created)\n            * 400 (invalid object data specified)\n            * 409 (object with such parameters already exists)\n        ' #NEWLINE# data = self . checked_data ( ) #NEWLINE# role_name = data [ 'name' ] #NEWLINE# release = self . get_object_or_404 ( objects . Release , release_id ) #NEWLINE# if ( role_name in release . roles_metadata ) : #NEWLINE# #INDENT# raise self . http ( 409 , 'Role with name {name} already exists for release {release}' . format ( name = role_name , release = release_id ) ) #NEWLINE# #UNINDENT# objects . Release . update_role ( release , data ) #NEWLINE# raise self . http ( 201 , RoleSerializer . serialize_from_release ( release , role_name ) )