File tree 2 files changed +6
-1
lines changed
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 36
36
from readthedocs .core .utils import extract_valid_attributes_for_model , slugify
37
37
from readthedocs .core .utils .url import unsafe_join_url_path
38
38
from readthedocs .domains .querysets import DomainQueryset
39
+ from readthedocs .domains .validators import check_domains_limit
39
40
from readthedocs .notifications .models import Notification as NewNotification
40
41
from readthedocs .projects import constants
41
42
from readthedocs .projects .exceptions import ProjectConfigurationError
@@ -1817,6 +1818,9 @@ def restart_validation_process(self):
1817
1818
self .validation_process_start = timezone .now ()
1818
1819
self .save ()
1819
1820
1821
+ def clean (self ):
1822
+ check_domains_limit (self .project )
1823
+
1820
1824
def save (self , * args , ** kwargs ):
1821
1825
parsed = urlparse (self .domain )
1822
1826
if parsed .scheme or parsed .netloc :
Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ def RTD_DEFAULT_FEATURES(self):
170
170
171
171
return dict (
172
172
(
173
- RTDProductFeature (type = constants .TYPE_CNAME ).to_item (),
173
+ # Max number of domains allowed per project.
174
+ RTDProductFeature (type = constants .TYPE_CNAME , value = 2 ).to_item (),
174
175
RTDProductFeature (type = constants .TYPE_EMBED_API ).to_item (),
175
176
# Retention days for search analytics.
176
177
RTDProductFeature (
You can’t perform that action at this time.
0 commit comments