#NEWLINE# def validate( self , attrs ) : #NEWLINE# #INDENT# formula = self . instance #NEWLINE# git_password = attrs . get ( 'git_password' ) #NEWLINE# if ( formula . private_git_repo and ( not formula . access_token ) ) : #NEWLINE# #INDENT# if ( not git_password ) : #NEWLINE# #INDENT# raise serializers . ValidationError ( { #NEWLINE# #INDENT# 'git_password' : [ 'This is a required field on private formulas.' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return attrs