Run python-modernize on openedx/core/djangoapps/heartbeat and openedx/core/djangoapps/signals
This commit is contained in:
Ana Maria Rodriguez
2019-04-24 14:07:32 -05:00
parent 3b7f588b09
commit 75cae7ebd2
7 changed files with 8 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
"""
Configuration for password_policy Django app
"""
from __future__ import absolute_import
import logging
import six
from dateutil.parser import parse as parse_date

View File

@@ -1,6 +1,7 @@
"""
Utilities for enforcing and tracking compliance with password policy rules.
"""
from __future__ import absolute_import
from datetime import datetime
import pytz
@@ -142,7 +143,7 @@ def _get_compliance_deadline_for_user(user):
staff_deadline = staff_deadline if staff_deadline and user.is_staff else None
# Take minimum remaining deadline
filtered_deadlines = filter(None, (staff_deadline, privilege_deadline, general_deadline,))
filtered_deadlines = [_f for _f in (staff_deadline, privilege_deadline, general_deadline,) if _f]
return min(filtered_deadlines) if filtered_deadlines else None

View File

@@ -1,6 +1,7 @@
"""
Forms for the password policy app.
"""
from __future__ import absolute_import
from django.contrib import messages
from django.contrib.admin.forms import AdminAuthenticationForm
from django.forms import ValidationError

View File

@@ -2,6 +2,7 @@
Test password policy settings
"""
from __future__ import absolute_import
import datetime
from dateutil.parser import parse as parse_date
from django.conf import settings

View File

@@ -1,6 +1,7 @@
"""
Test password policy utilities
"""
from __future__ import absolute_import
from datetime import datetime, timedelta
import pytz

View File

@@ -1,6 +1,7 @@
"""
Test password policy forms
"""
from __future__ import absolute_import
import mock
from django.forms import ValidationError

View File

@@ -2,6 +2,7 @@
This module contains all general use signals.
"""
from __future__ import absolute_import
from django.dispatch import Signal
# Signal that fires when a user is graded