Skip to content

Commit d142959

Browse files
author
ndu
committed
Merge branch 'main' into feat/algolia
2 parents be6ca0f + 9b36791 commit d142959

File tree

12 files changed

+164
-326
lines changed

12 files changed

+164
-326
lines changed

server/apps/research/admin/article_admin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def __init__(self, *args, **kwargs):
4646
'id': "gpt_summary_richtext_field",
4747
'placeholder': "GPT-generated summary will appear here"
4848
})
49-
self.fields['primary_category'].queryset = Category.objects.all()
5049

5150
class ArticleAdmin(admin.ModelAdmin):
5251
"""Admin interface for the Article model."""
@@ -93,7 +92,7 @@ def current_slug_history(self, obj):
9392
fieldsets = [
9493
('Article Details', {
9594
'fields': [
96-
'title', 'slug', 'authors', 'acknowledgement', 'categories', 'primary_category',
95+
'title', 'slug', 'authors', 'acknowledgement', 'categories',
9796
'thumb', 'content', 'summary', 'gpt_summary', 'status', 'scheduled_publish_time'
9897
]
9998
}),

server/apps/research/apps.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
from django.apps import AppConfig
2-
import algoliasearch_django as algoliasearch
3-
from algoliasearch_django.registration import RegistrationError
2+
43

54
class ResearchConfig(AppConfig):
65
default_auto_field = 'django.db.models.BigAutoField'
76
name = 'apps.research'
8-
9-
def ready(self):
10-
from .models.article import Article
11-
from .models.author import Author
12-
from .models.category import Category
13-
from .models.algolia_index import ArticleIndex, AuthorIndex, CategoryIndex
14-
15-
try:
16-
algoliasearch.register(Article, ArticleIndex)
17-
algoliasearch.register(Author, AuthorIndex)
18-
algoliasearch.register(Category, CategoryIndex)
19-
except RegistrationError:
20-
pass
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .category import Category
22
from .author import Author
3-
from .article import Article, ArticleSlugHistory
3+
from .article import Article, ArticleSlugHistory

server/apps/research/models/algolia_index.py

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)