'A repository\'s type can only be changed to the unrestricted type if it is new or has never been installed.'

def is_valid_for_type(self, app, repository, revisions_to_check=None):

    if repository.is_new(app):
        return True
    if (repository.times_downloaded == 0):
        return True
    return False
