Reenable black.

This commit is contained in:
Norman Jäckel 2019-01-28 20:53:16 +01:00
parent 746dbf744b
commit 39244a0ec9
5 changed files with 12 additions and 14 deletions

View File

@ -34,7 +34,7 @@ matrix:
script:
- flake8 openslides tests
- isort --check-only --diff --recursive openslides tests
#- black --check --diff --py36 openslides tests
- black --check --diff --py36 openslides tests
- python -m mypy openslides/ tests/
- python -W ignore -m pytest --cov --cov-fail-under=70

View File

@ -20,7 +20,7 @@ Core:
- Fixed autoupdate system for related objects [#4140].
- Add a change-id system to get only new elements [#3938].
- Switch from Yarn back to npm [#3964].
- Added password reset link (password reset via email) [#3914].
- Added password reset link (password reset via email) [#3914, #4199].
- Added global history mode [#3977, #4141].
- Projector refactoring [4119, #4130].

View File

@ -40,6 +40,4 @@ class Migration(migrations.Migration):
dependencies = [("core", "0013_auto_20190119_1641")]
operations = [
migrations.RunPython(change_font_default_path),
]
operations = [migrations.RunPython(change_font_default_path)]

View File

@ -235,17 +235,13 @@ class User(RESTModelMixin, PermissionsMixin, AbstractBaseUser):
try:
message = message.format(**message_format)
except KeyError as err:
raise ValidationError(
{"detail": f"Invalid property {err}."}
)
raise ValidationError({"detail": f"Invalid property {err}."})
subject_format = format_dict({"event_name": config["general_event_name"]})
try:
subject = subject.format(**subject_format)
except KeyError as err:
raise ValidationError(
{"detail": f"Invalid property {err}."}
)
raise ValidationError({"detail": f"Invalid property {err}."})
# Create an email and send it.
email = mail.EmailMessage(

View File

@ -607,7 +607,9 @@ class PasswordResetView(APIView):
for user in self.get_users(to_email):
current_site = get_current_site(request)
site_name = current_site.name
if has_perm(user, "users.can_change_password") or has_perm(user, "users.can_manage"):
if has_perm(user, "users.can_change_password") or has_perm(
user, "users.can_manage"
):
context = {
"email": to_email,
"site_name": site_name,
@ -690,8 +692,10 @@ class PasswordResetConfirmView(APIView):
user = self.get_user(uidb64)
if user is None:
raise ValidationError({"detail": "User does not exist."})
if not (has_perm(user, "users.can_change_password")
or has_perm(user, "users.can_manage")):
if not (
has_perm(user, "users.can_change_password")
or has_perm(user, "users.can_manage")
):
self.permission_denied(request)
if not default_token_generator.check_token(user, token):
raise ValidationError({"detail": "Invalid token."})