Skip to content
Browse files

Fix another instance of flail in Models

  • Loading branch information...
1 parent c2da0af commit e1cf690504e44e4aafe48319d1a9655057c90b8e @ericholscher ericholscher committed Nov 7, 2012
Showing with 3 additions and 9 deletions.
  1. +3 −9 readthedocs/projects/models.py
View
12 readthedocs/projects/models.py
@@ -14,7 +14,7 @@
from projects import constants
from projects.exceptions import ProjectImportError
from projects.templatetags.projects_tags import sort_version_aware
-from projects.utils import highest_version as _highest
+from projects.utils import highest_version as _highest, make_api_version, make_api_project
from taggit.managers import TaggableManager
from tastyapi.slum import api
@@ -449,14 +449,8 @@ def api_versions(self):
from builds.models import Version
ret = []
for version_data in api.version.get(project=self.pk, active=True)['objects']:
- del version_data['resource_uri']
- project_data = version_data['project']
- del project_data['users']
- del project_data['resource_uri']
- del project_data['absolute_url']
- project = Project(**project_data)
- version_data['project'] = project
- ret.append(Version(**version_data))
+ version = make_api_version(version_data)
+ ret.append(version)
return sort_version_aware(ret)
def active_versions(self):

0 comments on commit e1cf690

Please sign in to comment.
Something went wrong with that request. Please try again.