#NEWLINE# def grant_to( self , email , granter ) : #NEWLINE# #INDENT# 'Grant this deferred award to the given email' #NEWLINE# if ( not self . allows_grant_by ( granter ) ) : #NEWLINE# #INDENT# raise DeferredAwardGrantNotAllowedException ( ) #NEWLINE# #UNINDENT# if ( not self . reusable ) : #NEWLINE# #INDENT# self . email = email #NEWLINE# self . claim_code = make_random_code ( ) #NEWLINE# self . save ( ) #NEWLINE# return self #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# new_da = DeferredAward ( badge = self . badge , email = email , creator = granter , reusable = False ) #NEWLINE# new_da . save ( ) #NEWLINE# return new_da