Skip to content

Commit 3890242

Browse files
authored
Add missing Version.external_version_name (#10529)
* Add missing Version.external_version_name This was implemented on Build, but not Version. Version does have an opinionated version of this, but the output is "#4 (PR)" and I would like "Pull request" instead. * Formatting
1 parent 3eae8f5 commit 3890242

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Contributing
3838

3939
You can find information about contributing to Read the Docs at our `Contribution page <https://docs.readthedocs.io/en/latest/contribute.html>`_.
4040

41-
Quickstart for GitHub-Hosted Projects
41+
Quickstart for GitHub hosted projects
4242
-------------------------------------
4343

4444
By the end of this quickstart, you will have a new project automatically updated

readthedocs/builds/models.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ def explicit_name(self):
274274
abbrev = "".join(word[0].upper() for word in external_origin.split())
275275
return template.format(name=self.verbose_name, abbrev=abbrev)
276276

277+
@property
278+
def external_version_name(self):
279+
return external_version_name(self)
280+
277281
@property
278282
def ref(self):
279283
if self.slug == STABLE:
@@ -352,6 +356,7 @@ def commit_name(self):
352356

353357
# By now we must have handled all special versions.
354358
if self.slug in NON_REPOSITORY_VERSIONS:
359+
# pylint: disable=broad-exception-raised
355360
raise Exception('All special versions must be handled by now.')
356361

357362
if self.type in (BRANCH, TAG):
@@ -407,7 +412,7 @@ def get_absolute_url(self):
407412
external=external,
408413
)
409414

410-
def delete(self, *args, **kwargs): # pylint: disable=arguments-differ
415+
def delete(self, *args, **kwargs):
411416
from readthedocs.projects.tasks.utils import clean_project_resources
412417
log.info('Removing files for version.', version_slug=self.slug)
413418
clean_project_resources(self.project, self)
@@ -699,7 +704,7 @@ def __init__(self, *args, **kwargs):
699704

700705
super().__init__(*args, **valid_attributes)
701706

702-
def save(self, *args, **kwargs): # pylint: disable=arguments-differ
707+
def save(self, *args, **kwargs):
703708
return 0
704709

705710

@@ -1378,7 +1383,7 @@ def move(self, steps):
13781383
self.save()
13791384
return True
13801385

1381-
def delete(self, *args, **kwargs): # pylint: disable=arguments-differ
1386+
def delete(self, *args, **kwargs):
13821387
"""Override method to update the other priorities after delete."""
13831388
current_priority = self.priority
13841389
project = self.project

0 commit comments

Comments
 (0)