#NEWLINE# def perform_create( self , serializer ) : #NEWLINE# #INDENT# user = self . request . user #NEWLINE# name = serializer . validated_data [ 'name' ] #NEWLINE# if core_models . SshPublicKey . objects . filter ( user = user , name = name ) . exists ( ) : #NEWLINE# #INDENT# raise rf_serializers . ValidationError ( { #NEWLINE# #INDENT# 'name' : [ 'This field must be unique.' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# serializer . save ( user = user )