Skip to content

Commit b29b3b5

Browse files
committed
Solve issues after merge
1 parent 28b7606 commit b29b3b5

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

readthedocs/api/v3/tests/responses/projects-list_POST.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"_links": {
33
"_self": "https://readthedocs.org/api/v3/projects/test-project/",
44
"builds": "https://readthedocs.org/api/v3/projects/test-project/builds/",
5+
"redirects": "https://readthedocs.org/api/v3/projects/test-project/redirects/",
56
"subprojects": "https://readthedocs.org/api/v3/projects/test-project/subprojects/",
67
"superproject": "https://readthedocs.org/api/v3/projects/test-project/superproject/",
78
"translations": "https://readthedocs.org/api/v3/projects/test-project/translations/",

readthedocs/api/v3/tests/test_projects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import datetime
2-
import mock
32
import json
43
from pathlib import Path
54

readthedocs/api/v3/views.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from readthedocs.core.utils import trigger_build
2323
from readthedocs.projects.models import Project
2424
from readthedocs.projects.views.mixins import ProjectImportMixin
25+
from readthedocs.redirects.models import Redirect
2526

2627

2728
from .filters import BuildFilter, ProjectFilter, VersionFilter
@@ -206,8 +207,6 @@ def perform_create(self, serializer):
206207
Trigger our internal mechanism to import a project after it's saved in
207208
the database.
208209
"""
209-
serializer = self.get_serializer(data=request.data)
210-
serializer.is_valid(raise_exception=True)
211210
project = serializer.save()
212211
self.finish_import_project(self.request, project)
213212

readthedocs/projects/views/mixins.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,18 @@ class ProjectImportMixin:
5555

5656
def finish_import_project(self, request, project, tags=None):
5757
"""
58-
Import a Project into Read the Docs.
58+
Perform last steps to import a project into Read the Docs.
5959
6060
- Add the user from request as maintainer
6161
- Set all the tags to the project
6262
- Send Django Signal
6363
- Trigger initial build
64+
65+
It requires the Project was already saved into the DB.
66+
67+
:param request: Django Request object
68+
:param project: Project instance just imported (already saved)
69+
:param tags: tags to add to the project
6470
"""
6571
if not tags:
6672
tags = []

0 commit comments

Comments
 (0)