#NEWLINE# def perform_create( self , serializer ) : #NEWLINE# #INDENT# affected_customer = serializer . validated_data [ 'customer' ] #NEWLINE# affected_user = serializer . validated_data [ 'user' ] #NEWLINE# if ( not self . can_manage_roles_for ( affected_customer ) ) : #NEWLINE# #INDENT# raise PermissionDenied ( 'You do not have permission to perform this action.' ) #NEWLINE# #UNINDENT# if ( not affected_customer . get_users ( ) . filter ( pk = affected_user . pk ) . exists ( ) ) : #NEWLINE# #INDENT# affected_customer . validate_quota_change ( { #NEWLINE# #INDENT# 'nc_user_count' : 1 , #NEWLINE# #UNINDENT# } , raise_exception = True ) #NEWLINE# #UNINDENT# super ( CustomerPermissionViewSet , self ) . perform_create ( serializer )