Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 02e81e1

Browse files
committed
Merge branch 'master' of https://github.com/diwash007/python-blogs into mysql
2 parents 0facfa0 + 597ee93 commit 02e81e1

25 files changed

Lines changed: 713 additions & 202 deletions

File tree

‎.gitignore‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# $GIT_DIR/info/exclude or the core.excludesFile configuration variable as
33
# described in https://git-scm.com/docs/gitignore
44
settings_local.py
5-
credentials.json
5+
Pipfile
6+
Pipfile.lock
7+
68
# Byte-compiled / optimized / DLL files
79
__pycache__/
810
*.py[cod]
@@ -21,5 +23,5 @@ logs/*
2123
.vscode
2224

2325
# Google Calendar creds
24-
scripts/credentials.json
25-
google_api_token.pickle
26+
credentials.json
27+
token.json
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.
-41 Bytes
Binary file not shown.

‎aldryn_newsblog/views.py‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,16 @@ def get_queryset(self):
243243
qs = super(ArticleList, self).get_queryset()
244244
# exclude featured articles from queryset, to allow featured article
245245
# plugin on the list view page without duplicate entries in page qs.
246-
exclude_count = self.config.exclude_featured
247-
if exclude_count:
248-
featured_qs = Article.objects.all().filter(is_featured=True)
249-
if not self.edit_mode:
250-
featured_qs = featured_qs.published()
251-
exclude_featured = featured_qs[:exclude_count].values_list('pk')
252-
qs = qs.exclude(pk__in=exclude_featured)
246+
try:
247+
exclude_count = self.config.exclude_featured
248+
if exclude_count:
249+
featured_qs = Article.objects.all().filter(is_featured=True)
250+
if not self.edit_mode:
251+
featured_qs = featured_qs.published()
252+
exclude_featured = featured_qs[:exclude_count].values_list('pk')
253+
qs = qs.exclude(pk__in=exclude_featured)
254+
except Exception:
255+
pass
253256
return qs
254257

255258

-41 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)