Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Aug 9, 2024
1 parent ced07f9 commit 306d0e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pretalx_downstream/management/commands/downstream_pull.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ def handle(self, *args, **options):
if sync:
task_refresh_upstream_schedule(event_slug)
else:
task_refresh_upstream_schedule.apply_async(args=(event_slug,), ignore_result=True)
task_refresh_upstream_schedule.apply_async(
args=(event_slug,), ignore_result=True
)
6 changes: 3 additions & 3 deletions pretalx_downstream/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import json
from contextlib import suppress
from logging import getLogger
from xml.etree import ElementTree as ET
from xml.etree import ElementTree

import dateutil.parser
import requests
Expand Down Expand Up @@ -64,7 +64,7 @@ def task_refresh_upstream_schedule(event_slug):
event.settings.upstream_last_sync = now()
return

root = ET.fromstring(content)
root = ElementTree.fromstring(content)
schedule_version = root.find("version").text

if event.settings.downstream_discard_after:
Expand Down Expand Up @@ -230,7 +230,7 @@ def _create_talk(*, talk, room, event):
defaults={"submission_type": sub_type, "state": SubmissionStates.CONFIRMED},
)
except IntegrityError:
new_code = f"{event.slug[:16-len(code)]}{code}"
new_code = f"{event.slug[:16 - len(code)]}{code}"
sub, created = Submission.objects.get_or_create(
event=event,
code=new_code,
Expand Down
4 changes: 3 additions & 1 deletion pretalx_downstream/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def post(self, request, *args, **kwargs):
action = request.POST.get("action", "save")
if action == "refresh":
try:
task_refresh_upstream_schedule.apply_async(args=(request.event.slug,), ignore_result=True)
task_refresh_upstream_schedule.apply_async(
args=(request.event.slug,), ignore_result=True
)
messages.success(request, _("Refreshing schedule …"))
except Exception as e:
messages.error(
Expand Down

0 comments on commit 306d0e1

Please sign in to comment.