Skip to content

Commit 68efbd4

Browse files
author
Ryan Ginstrom
committed
Fix double import of projects.api
1 parent dca8e1d commit 68efbd4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

readthedocs/projects/models.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from readthedocs.core.utils import broadcast, slugify
2121
# transitioning from v1 to v2, rename for now, remove later
2222
from readthedocs.restapi.client import api
23-
from readthedocs.restapi.client import api as apiv2
2423
from readthedocs.builds.constants import LATEST, LATEST_VERBOSE_NAME, STABLE
2524
from readthedocs.projects import constants
2625
from readthedocs.projects.exceptions import ProjectImportError
@@ -359,7 +358,7 @@ def get_builds_url(self):
359358

360359
def get_canonical_url(self):
361360
if getattr(settings, 'DONT_HIT_DB', True):
362-
return apiv2.project(self.pk).canonical_url().get()['url']
361+
return api.project(self.pk).canonical_url().get()['url']
363362
return self.get_docs_url()
364363

365364
def get_subproject_urls(self):
@@ -370,7 +369,7 @@ def get_subproject_urls(self):
370369
if getattr(settings, 'DONT_HIT_DB', True):
371370
return [(proj['slug'], proj['canonical_url'])
372371
for proj in (
373-
apiv2.project(self.pk)
372+
api.project(self.pk)
374373
.subprojects()
375374
.get()['subprojects'])]
376375
return [(proj.child.slug, proj.child.get_docs_url())

0 commit comments

Comments
 (0)