From 84b6ed83f38f59d2be79f32fb89bf2b43aec5d42 Mon Sep 17 00:00:00 2001 From: Tahzib Mashrik Date: Sun, 25 Mar 2018 20:18:13 +0600 Subject: [PATCH] move validators --- readthedocs/projects/migrations/0010_migrate_domain_data.py | 4 ++-- readthedocs/projects/models.py | 2 +- readthedocs/{core => projects}/validators.py | 2 +- readthedocs/vcs_support/backends/git.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename readthedocs/{core => projects}/validators.py (99%) diff --git a/readthedocs/projects/migrations/0010_migrate_domain_data.py b/readthedocs/projects/migrations/0010_migrate_domain_data.py index a4dd2e2bc47..ef60b2a00d1 100644 --- a/readthedocs/projects/migrations/0010_migrate_domain_data.py +++ b/readthedocs/projects/migrations/0010_migrate_domain_data.py @@ -4,7 +4,7 @@ from django.db import models, migrations from future.backports.urllib.parse import urlparse -import readthedocs.core.validators +import readthedocs.projects.validators def migrate_url(apps, schema_editor): @@ -46,7 +46,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='domain', name='domain', - field=models.CharField(unique=True, max_length=255, verbose_name='Domain', validators=[readthedocs.core.validators.DomainNameValidator()]), + field=models.CharField(unique=True, max_length=255, verbose_name='Domain', validators=[readthedocs.projects.validators.DomainNameValidator()]), ), ] diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 1b88429a937..3b578e4655e 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -22,13 +22,13 @@ from readthedocs.builds.constants import LATEST, LATEST_VERBOSE_NAME, STABLE from readthedocs.core.resolver import resolve, resolve_domain from readthedocs.core.utils import broadcast, slugify -from readthedocs.core.validators import validate_domain_name, validate_repository_url from readthedocs.projects import constants from readthedocs.projects.exceptions import ProjectConfigurationError from readthedocs.projects.querysets import ( ChildRelatedProjectQuerySet, FeatureQuerySet, ProjectQuerySet, RelatedProjectQuerySet) from readthedocs.projects.templatetags.projects_tags import sort_version_aware +from readthedocs.projects.validators import validate_domain_name, validate_repository_url from readthedocs.projects.version_handling import ( determine_stable_version, version_windows) from readthedocs.restapi.client import api diff --git a/readthedocs/core/validators.py b/readthedocs/projects/validators.py similarity index 99% rename from readthedocs/core/validators.py rename to readthedocs/projects/validators.py index c8523f2d619..ac120ccf6e4 100644 --- a/readthedocs/core/validators.py +++ b/readthedocs/projects/validators.py @@ -1,4 +1,4 @@ -"""Validators for core app.""" +"""Validators for projects app.""" # From https://github.com/django/django/pull/3477/files from __future__ import absolute_import diff --git a/readthedocs/vcs_support/backends/git.py b/readthedocs/vcs_support/backends/git.py index 5b021ad066a..153ab6c1c50 100644 --- a/readthedocs/vcs_support/backends/git.py +++ b/readthedocs/vcs_support/backends/git.py @@ -14,8 +14,8 @@ from git.exc import BadName from six import PY2, StringIO -from readthedocs.core.validators import validate_submodule_url from readthedocs.projects.exceptions import RepositoryError +from readthedocs.projects.validators import validate_submodule_url from readthedocs.vcs_support.base import BaseVCS, VCSVersion log = logging.getLogger(__name__)