File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 34
34
START_SEL ,
35
35
STOP_SEL ,
36
36
TSEARCH_CONFIG_LANGUAGES ,
37
+ DocumentationCategory ,
37
38
)
38
39
39
40
@@ -237,9 +238,12 @@ def _sync_blog_to_db(self):
237
238
metadata = {
238
239
"body" : entry .body_html ,
239
240
"breadcrumbs" : [
240
- {"path" : "weblog" , "title" : "News" },
241
+ {
242
+ "path" : DocumentationCategory .WEBSITE .value ,
243
+ "title" : "News" ,
244
+ },
241
245
],
242
- "parents" : "weblog" ,
246
+ "parents" : DocumentationCategory . WEBSITE . value ,
243
247
"slug" : entry .slug ,
244
248
"title" : entry .headline ,
245
249
"toc" : "" ,
@@ -279,9 +283,12 @@ def _sync_views_to_db(self):
279
283
metadata = {
280
284
"body" : body ,
281
285
"breadcrumbs" : [
282
- {"path" : "weblog" , "title" : "Website" },
286
+ {
287
+ "path" : DocumentationCategory .WEBSITE .value ,
288
+ "title" : "Website" ,
289
+ },
283
290
],
284
- "parents" : "weblog" ,
291
+ "parents" : DocumentationCategory . WEBSITE . value ,
285
292
"slug" : url_name ,
286
293
"title" : title ,
287
294
"toc" : "" ,
@@ -303,7 +310,7 @@ def _clean_document_path(path):
303
310
304
311
305
312
def document_url (doc ):
306
- if doc .metadata ["parents" ] == "weblog" :
313
+ if doc .metadata ["parents" ] == DocumentationCategory . WEBSITE . value :
307
314
return doc .path
308
315
elif doc .path :
309
316
kwargs = {
Original file line number Diff line number Diff line change 11
11
from releases .models import Release
12
12
13
13
from ..models import DOCUMENT_SEARCH_VECTOR , Document , DocumentRelease
14
+ from ..search import DocumentationCategory
14
15
15
16
16
17
class ModelsTests (TestCase ):
@@ -480,7 +481,9 @@ def setUpTestData(cls):
480
481
slug = "a" ,
481
482
body_html = "<h1>Searchable Blog Post</h1>" ,
482
483
)
483
- cls .docs_documents = cls .release .documents .exclude (metadata__parents = "weblog" )
484
+ cls .docs_documents = cls .release .documents .exclude (
485
+ metadata__parents = DocumentationCategory .WEBSITE .value
486
+ )
484
487
485
488
def test_sync_to_db (self ):
486
489
self .release .sync_to_db (
You can’t perform that action at this time.
0 commit comments