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

Commit 6adcfc9

Browse files
committed
fix conflict
2 parents 8893475 + 80d1d71 commit 6adcfc9

16 files changed

+264
-167
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
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+
67
# Byte-compiled / optimized / DLL files
78
__pycache__/
89
*.py[cod]
@@ -21,5 +22,5 @@ logs/*
2122
.vscode
2223

2324
# Google Calendar creds
24-
scripts/credentials.json
25-
google_api_token.pickle
25+
credentials.json
26+
token.json

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

blogs_list/feeds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def get_object(self, request):
146146
articles = list(articles_all[start_index:end_index])
147147
return articles
148148
else:
149-
raise ObjectDoesNotExist
149+
return []
150150

151151
def feed_extra_kwargs(self, obj):
152152
return {

docs/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ Default student users are `student-1`, `student-2`, `student-3` and `student-4`
3636
## Contributing
3737
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
3838

39+
## Google OAuth
40+
- Go to https://console.cloud.google.com/ and create a new project
41+
- Enable Google Calendar API and create an OAuth 2.0 client ID
42+
- add following on the Authorised redirect URIs of OAuth client ID
43+
```bash
44+
http://localhost/
45+
```
46+
- Download the JSON file and rename it to `credentials.json`
47+
- Move the file to the root folder of the project
48+
3949
## Virtualenv
4050

4151
A virtual environment is a tool that helps to keep dependencies required by different projects separate by creating isolated python virtual environments for them. This means that each project can have its own dependencies, regardless of what dependencies every other project has. We use a module named `virtualenv` which is a tool to create isolated Python environments. `virtualenv` creates a folder which contains all the necessary executables to use the packages that a Python project would need.

gsoc/common/utils/tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def send_mail(send_to, subject, template, context={}):
4747
subject=settings.EMAIL_SUBJECT_PREFIX + subject,
4848
from_email=settings.SERVER_EMAIL,
4949
reply_to=settings.REPLY_EMAIL,
50-
to=send_to,
50+
to=settings.ADMINS,
51+
bcc=send_to,
5152
)
5253
send_email.content_subtype = "html"
5354
send_email.send()

gsoc/constants.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# days
2+
PRE_BLOG_REMINDER = -3
3+
POST_BLOG_REMINDER_FIRST = 1
4+
POST_BLOG_REMINDER_SECOND = 3
5+
6+
BLOG_POST_DUE_REMINDER = -6
7+
UPDATE_BLOG_COUNTER = 6
8+
9+
DEFAULT_TRIGGER_TIME = 3

gsoc/forms.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
from PIL import Image
23

34
from .models import (
@@ -51,7 +52,7 @@ class Meta:
5152
class BlogPostDueDateForm(forms.ModelForm):
5253
class Meta:
5354
model = BlogPostDueDate
54-
fields = ("title", "date", "category")
55+
fields = ("category", "date", "title")
5556

5657

5758
class EventForm(forms.ModelForm):
@@ -121,8 +122,12 @@ def clean(self):
121122

122123
if not suborg and suborg_name:
123124
suborg = SubOrg.objects.filter(suborg_name=suborg_name)
124-
if len(suborg) > 0:
125+
if suborg:
125126
cd["suborg"] = suborg.first()
127+
else:
128+
regex = r'^[ a-zA-Z\-]*$'
129+
if not re.match(regex, suborg_name):
130+
raise ValidationError("Invalid suborg name.")
126131
elif suborg and not suborg_name:
127132
cd["suborg_name"] = suborg.suborg_name
128133
elif suborg and suborg_name:

gsoc/management/commands/googleapiauth.py

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 3.2.11 on 2022-06-14 14:04
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('gsoc', '0006_notaccepteduser'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='builder',
16+
name='timeline',
17+
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='gsoc.timeline'),
18+
),
19+
]

0 commit comments

Comments
 (0)