import json


def user_exists(uname):
    """Checks if user exists in the passfile"""
    with open('passfile.txt', 'r') as f:
        for line in f:
            user = json.loads(line)
            if user['username'] == uname:
                return True
        return False