'This automatically adds the recovery code backup interface in
case no backup interface is currently set for the user.  Returns
the interface that was added.'

def auto_add_recovery_codes(self, user, force=False):

    has_authenticators = False
    if (not force):
        for authenticator in Authenticator.objects.filter(user=user, type__in=[a.type for a in available_authenticators()]):
            iface = authenticator.interface
            if iface.is_backup_interface:
                return
            has_authenticators = True
    if (has_authenticators or force):
        interface = RecoveryCodeInterface()
        interface.enroll(user)
        return interface
