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

Commit 2af7849

Browse files
committed
pep8 fixes
1 parent 90865b8 commit 2af7849

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

gsoc/common/utils/build_tasks.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
from django.utils import timezone
55
from django.conf import settings
66

7-
from gsoc.models import Event, Timeline, UserProfile, GsocYear, BlogPostDueDate, Scheduler, ReaddUser
7+
from gsoc.models import (Event, Timeline,UserProfile, GsocYear,
8+
BlogPostDueDate, Scheduler, ReaddUser
9+
)
810
from gsoc.common.utils.tools import build_send_mail_json
911

1012
from googleapiclient.discovery import build
@@ -161,13 +163,14 @@ def build_remove_user_details(builder):
161163
def build_add_timeline_to_calendar(builder):
162164
data = json.loads(builder.data)
163165
if not data["calendar_id"]:
164-
creds = getCreds()
165-
service = build("calendar", "v3", credentials=creds, cache_discovery=False)
166-
calendar = {"summary": "GSoC @ PSF Calendar", "timezone": "UTC"}
167-
calendar = service.calendars().insert(body=calendar).execute()
168-
timeline = Timeline.objects.get(id=data["timeline_id"])
169-
timeline.calendar_id = calendar.get("id")
170-
timeline.save()
166+
creds = getCreds()
167+
service = build("calendar", "v3", credentials=creds, cache_discovery=False)
168+
calendar = {"summary": "GSoC @ PSF Calendar", "timezone": "UTC"}
169+
calendar = service.calendars().insert(body=calendar).execute()
170+
timeline = Timeline.objects.get(id=data["timeline_id"])
171+
timeline.calendar_id = calendar.get("id")
172+
timeline.save()
173+
171174

172175
def build_add_bpdd_to_calendar(builder):
173176
data = json.loads(builder.data)
@@ -193,6 +196,7 @@ def build_add_bpdd_to_calendar(builder):
193196
calendarId=cal_id, eventId=data["event_id"], body=event
194197
).execute()
195198

199+
196200
def build_add_event_to_calendar(builder):
197201
data = json.loads(builder.data)
198202
creds = getCreds()
@@ -215,4 +219,4 @@ def build_add_event_to_calendar(builder):
215219
else:
216220
service.events().update(
217221
calendarId=cal_id, eventId=item.event_id, body=event
218-
).execute()
222+
).execute()

gsoc/common/utils/googleoauth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def getCreds():
2727
creds = flow.run_local_server(port=0)
2828
with open(os.path.join(BASE_DIR, 'token.json'), 'w') as token:
2929
token.write(creds.to_json())
30-
return creds
30+
return creds

0 commit comments

Comments
 (0)