Moved has_repo check to a model.