Skip to content

Commit

Permalink
Fix coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquan committed Feb 20, 2025
1 parent 4a75197 commit d5f7219
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 5 additions & 7 deletions src/pretalx/cfp/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import json
import logging
from collections import OrderedDict
from configparser import RawConfigParser
from contextlib import suppress
from pathlib import Path
from configparser import RawConfigParser
from typing import cast

from django.conf import settings
Expand All @@ -25,10 +25,9 @@
from i18nfield.utils import I18nJSONEncoder

from pretalx.cfp.signals import cfp_steps
from pretalx.common.text.phrases import CALL_FOR_SPEAKER_LOGIN_BTN_LABELS
from pretalx.common.exceptions import SendMailException
from pretalx.common.language import language
from pretalx.common.text.phrases import phrases
from pretalx.common.text.phrases import CALL_FOR_SPEAKER_LOGIN_BTN_LABELS, phrases
from pretalx.person.forms import SpeakerProfileForm, UserForm
from pretalx.person.models import User
from pretalx.submission.forms import InfoForm, QuestionsForm
Expand All @@ -39,7 +38,6 @@
Track,
)


logger = logging.getLogger(__name__)


Expand Down Expand Up @@ -191,15 +189,15 @@ def get_context_data(self, **kwargs):
# Select label for login button
config = cast(RawConfigParser, settings.CONFIG)
try:
key = config['site']['call_for_speaker_login_button_label']
key = config["site"]["call_for_speaker_login_button_label"]
except KeyError:
# TODO: The logs cannot be observed with the development Docker setup. Should be fixed.
logger.info("Config file misses `call_for_speaker_login_button_label` key!")
key = 'default'
key = "default"
try:
button_label = CALL_FOR_SPEAKER_LOGIN_BTN_LABELS[key]
except KeyError:
button_label = CALL_FOR_SPEAKER_LOGIN_BTN_LABELS['default']
button_label = CALL_FOR_SPEAKER_LOGIN_BTN_LABELS["default"]
kwargs.setdefault("login_button_label", button_label)
return kwargs

Expand Down
10 changes: 6 additions & 4 deletions src/pretalx/common/settings/config.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import configparser
import logging
import os
import sys
import logging
from pathlib import Path
from configparser import RawConfigParser

from pathlib import Path

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -171,7 +170,10 @@ def read_config_files(config: RawConfigParser) -> tuple[RawConfigParser, list[st
config.read_file(fp)
config_files = [str(file_path.resolve())]
else:
logger.warning("File specified by PRETALX_CONFIG_FILE does not exist. %s", path_from_env)
logger.warning(
"File specified by PRETALX_CONFIG_FILE does not exist. %s",
path_from_env,
)
config_files = []
else:
config_files = config.read(
Expand Down
4 changes: 2 additions & 2 deletions src/pretalx/common/text/phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ class BasePhrases(Phrases, app="base"):

# We want to show different button label depending on deployment site.
CALL_FOR_SPEAKER_LOGIN_BTN_LABELS = {
'default': _('Login'),
'mediawiki': _('Login with MediaWiki SSO or Email'),
"default": _("Login"),
"mediawiki": _("Login with MediaWiki SSO or Email"),
}

0 comments on commit d5f7219

Please sign in to comment.