def verify_id_email_for_email_update(uid, email): user = UserDatabaseService.get_user_by_id(uid) if not user: return {'result': False, 'error': 'No user found with id {}.'.format(uid)} if isinstance(user, dict) and 'error' in user.keys(): return user if user and user.email != email: return {'result': False, 'error': 'Mismatch in id and oldEmail. Please correct the pair and retry again.'} return True
def get_existing_user_by_id(identity) -> dict: user = UserDatabaseService.get_user_by_id(identity) # gives an object if isinstance(user, dict): return user return dataStateAccess.UserDTO.user_dto(user)