Skip to content

Commit bde0088

Browse files
authored
Merge pull request #4099 from italia/settingslatest
Make the STABLE and LATEST constants overridable
2 parents a29fea4 + a07663a commit bde0088

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

readthedocs/builds/constants.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import absolute_import
44
from django.utils.translation import ugettext_lazy as _
5+
from django.conf import settings
56

67
BUILD_STATE_TRIGGERED = 'triggered'
78
BUILD_STATE_CLONING = 'cloning'
@@ -38,11 +39,11 @@
3839
(UNKNOWN, _('Unknown')),
3940
)
4041

41-
LATEST = 'latest'
42-
LATEST_VERBOSE_NAME = 'latest'
42+
LATEST = getattr(settings, 'RTD_LATEST', 'latest')
43+
LATEST_VERBOSE_NAME = getattr(settings, 'RTD_LATEST_VERBOSE_NAME', 'latest')
4344

44-
STABLE = 'stable'
45-
STABLE_VERBOSE_NAME = 'stable'
45+
STABLE = getattr(settings, 'RTD_STABLE', 'stable')
46+
STABLE_VERBOSE_NAME = getattr(settings, 'RTD_STABLE_VERBOSE_NAME', 'stable')
4647

4748
# Those names are specialcased version names. They do not correspond to
4849
# branches/tags in a project's repository.

0 commit comments

Comments
 (0)