In all cases where a note given by the purchaser and grantee of real estate to the vendor and grantor thereof to secure payment of all or any part of the purchase price is secured by a mortgage on such real estate, such note shall bear an endorsement upon its face to the effect that it is given for such purpose, and thereafter the same shall not be negotiable, nor shall any liability of any kind be enforced upon it either by action at law, or by set-off, or counterclaim, or otherwise, excepting by foreclosure of the mortgage. The rights of any party to said note, or of any assignee, or purchaser thereof, shall not be affected by the absence of such endorsement but shall be the same as though such note had been properly endorsed. Nothing herein contained shall apply to such note given prior to July 1, 1933.
SDCL 44-8-21