Reenable black.
This commit is contained in:
parent
746dbf744b
commit
39244a0ec9
@ -34,7 +34,7 @@ matrix:
|
|||||||
script:
|
script:
|
||||||
- flake8 openslides tests
|
- flake8 openslides tests
|
||||||
- isort --check-only --diff --recursive 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 -m mypy openslides/ tests/
|
||||||
- python -W ignore -m pytest --cov --cov-fail-under=70
|
- python -W ignore -m pytest --cov --cov-fail-under=70
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ Core:
|
|||||||
- Fixed autoupdate system for related objects [#4140].
|
- Fixed autoupdate system for related objects [#4140].
|
||||||
- Add a change-id system to get only new elements [#3938].
|
- Add a change-id system to get only new elements [#3938].
|
||||||
- Switch from Yarn back to npm [#3964].
|
- 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].
|
- Added global history mode [#3977, #4141].
|
||||||
- Projector refactoring [4119, #4130].
|
- Projector refactoring [4119, #4130].
|
||||||
|
|
||||||
|
@ -40,6 +40,4 @@ class Migration(migrations.Migration):
|
|||||||
|
|
||||||
dependencies = [("core", "0013_auto_20190119_1641")]
|
dependencies = [("core", "0013_auto_20190119_1641")]
|
||||||
|
|
||||||
operations = [
|
operations = [migrations.RunPython(change_font_default_path)]
|
||||||
migrations.RunPython(change_font_default_path),
|
|
||||||
]
|
|
||||||
|
@ -235,17 +235,13 @@ class User(RESTModelMixin, PermissionsMixin, AbstractBaseUser):
|
|||||||
try:
|
try:
|
||||||
message = message.format(**message_format)
|
message = message.format(**message_format)
|
||||||
except KeyError as err:
|
except KeyError as err:
|
||||||
raise ValidationError(
|
raise ValidationError({"detail": f"Invalid property {err}."})
|
||||||
{"detail": f"Invalid property {err}."}
|
|
||||||
)
|
|
||||||
|
|
||||||
subject_format = format_dict({"event_name": config["general_event_name"]})
|
subject_format = format_dict({"event_name": config["general_event_name"]})
|
||||||
try:
|
try:
|
||||||
subject = subject.format(**subject_format)
|
subject = subject.format(**subject_format)
|
||||||
except KeyError as err:
|
except KeyError as err:
|
||||||
raise ValidationError(
|
raise ValidationError({"detail": f"Invalid property {err}."})
|
||||||
{"detail": f"Invalid property {err}."}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Create an email and send it.
|
# Create an email and send it.
|
||||||
email = mail.EmailMessage(
|
email = mail.EmailMessage(
|
||||||
|
@ -607,7 +607,9 @@ class PasswordResetView(APIView):
|
|||||||
for user in self.get_users(to_email):
|
for user in self.get_users(to_email):
|
||||||
current_site = get_current_site(request)
|
current_site = get_current_site(request)
|
||||||
site_name = current_site.name
|
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 = {
|
context = {
|
||||||
"email": to_email,
|
"email": to_email,
|
||||||
"site_name": site_name,
|
"site_name": site_name,
|
||||||
@ -690,8 +692,10 @@ class PasswordResetConfirmView(APIView):
|
|||||||
user = self.get_user(uidb64)
|
user = self.get_user(uidb64)
|
||||||
if user is None:
|
if user is None:
|
||||||
raise ValidationError({"detail": "User does not exist."})
|
raise ValidationError({"detail": "User does not exist."})
|
||||||
if not (has_perm(user, "users.can_change_password")
|
if not (
|
||||||
or has_perm(user, "users.can_manage")):
|
has_perm(user, "users.can_change_password")
|
||||||
|
or has_perm(user, "users.can_manage")
|
||||||
|
):
|
||||||
self.permission_denied(request)
|
self.permission_denied(request)
|
||||||
if not default_token_generator.check_token(user, token):
|
if not default_token_generator.check_token(user, token):
|
||||||
raise ValidationError({"detail": "Invalid token."})
|
raise ValidationError({"detail": "Invalid token."})
|
||||||
|
Loading…
Reference in New Issue
Block a user