*(minor): remove __name__ param from get_logger

This commit is contained in:
Langhammer, Jens 2019-10-04 10:08:53 +02:00
parent 2b8fed8f4e
commit c0df1f38b8
49 changed files with 48 additions and 50 deletions

View File

@ -1,7 +1,6 @@
[run]
source = passbook
omit =
env/
*/wsgi.py
manage.py
*/migrations/*

View File

@ -3,11 +3,9 @@ test-warnings: true
doc-warnings: false
ignore-paths:
- env
- migrations
- docs
- node_modules
- client-packages
uses:
- django

View File

@ -2,9 +2,10 @@
disable=redefined-outer-name,arguments-differ,no-self-use,cyclic-import,fixme,locally-disabled,unpacking-non-sequence,too-many-ancestors,too-many-branches,too-few-public-methods
load-plugins=pylint_django,pylint.extensions.bad_builtin
#,pylint.extensions.docparams
extension-pkg-whitelist=lxml
const-rgx=[a-zA-Z0-9_]{1,40}$
ignored-modules=django-otp
jobs=4
[SIMILARITIES]

View File

@ -8,7 +8,7 @@ from structlog import get_logger
from passbook.lib.utils.template import render_to_string
register = template.Library()
LOGGER = get_logger(__name__)
LOGGER = get_logger()
@register.simple_tag()
def get_links(model_instance):

View File

@ -10,7 +10,7 @@ from structlog import get_logger
from passbook.lib.models import UUIDModel
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class AuditEntry(UUIDModel):
"""An individual audit log entry"""

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.lib.config import CONFIG
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PassbookCoreConfig(AppConfig):
"""passbook core app config"""

View File

@ -3,7 +3,7 @@ from structlog import get_logger
from passbook.core.auth.factor import AuthenticationFactor
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class DummyFactor(AuthenticationFactor):

View File

@ -19,7 +19,7 @@ from passbook.core.tasks import send_email
from passbook.lib.config import CONFIG
from passbook.lib.utils.reflection import path_to_class
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def authenticate(request, backends, **credentials):

View File

@ -14,7 +14,7 @@ from passbook.lib.utils.reflection import class_to_path, path_to_class
from passbook.lib.utils.urls import is_url_absolute
from passbook.policy.engine import PolicyEngine
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def _redirect_with_qs(view, get_query_set=None):
"""Wrapper to redirect whilst keeping GET Parameters"""

View File

@ -9,7 +9,7 @@ from passbook.core.models import User
from passbook.lib.config import CONFIG
from passbook.lib.utils.ui import human_list
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class LoginForm(forms.Form):
"""Allow users to login"""

View File

@ -7,7 +7,7 @@ from structlog import get_logger
from passbook.core.models import User
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class Command(BaseCommand):
"""Import users from CSV file"""

View File

@ -8,7 +8,7 @@ from structlog import get_logger
from passbook.lib.config import CONFIG
from passbook.root.wsgi import application
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class Command(BaseCommand):

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.root.celery import CELERY_APP
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class Command(BaseCommand):

View File

@ -19,7 +19,7 @@ from passbook.lib.models import CreatedUpdatedModel, UUIDModel
from passbook.policy.exceptions import PolicyException
from passbook.policy.struct import PolicyRequest, PolicyResult
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def default_nonce_duration():

View File

@ -7,7 +7,7 @@ from structlog import get_logger
from passbook.core.exceptions import PasswordPolicyInvalid
LOGGER = get_logger(__name__)
LOGGER = get_logger()
user_signed_up = Signal(providing_args=['request', 'user'])
invitation_created = Signal(providing_args=['request', 'invitation'])

View File

@ -10,7 +10,7 @@ from passbook.core.models import Nonce
from passbook.lib.config import CONFIG
from passbook.root.celery import CELERY_APP
LOGGER = get_logger(__name__)
LOGGER = get_logger()
@CELERY_APP.task()
def send_email(to_address, subject, template, context):

View File

@ -5,7 +5,7 @@ from structlog import get_logger
from passbook.core.auth import view
from passbook.core.views import authentication, overview, user
LOGGER = get_logger(__name__)
LOGGER = get_logger()
urlpatterns = [
# Authentication views

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.core.models import Application
from passbook.policy.engine import PolicyEngine
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class AccessMixin:
"""Mixin class for usage in Authorization views.

View File

@ -20,7 +20,7 @@ from passbook.core.signals import invitation_used, user_signed_up
from passbook.core.tasks import send_email
from passbook.lib.config import CONFIG
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class LoginView(UserPassesTestMixin, FormView):

View File

@ -8,7 +8,7 @@ from structlog import get_logger
from passbook.core.models import Policy, PolicyResult, User
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class HaveIBeenPwendPolicy(Policy):
"""Check if password is on HaveIBeenPwned's list by upload the first

View File

@ -5,7 +5,7 @@ from structlog import get_logger
from passbook.ldap.ldap_connector import LDAPConnector
from passbook.ldap.models import LDAPSource
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class LDAPBackend(ModelBackend):

View File

@ -9,7 +9,7 @@ from passbook.core.models import User
from passbook.ldap.models import LDAPSource
from passbook.lib.config import CONFIG
LOGGER = get_logger(__name__)
LOGGER = get_logger()
USERNAME_FIELD = CONFIG.y('ldap.username_field', 'sAMAccountName')
LOGIN_FIELD = CONFIG.y('ldap.login_field', 'userPrincipalName')

View File

@ -1,7 +1,7 @@
"""passbook sentry integration"""
from structlog import get_logger
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def before_send(event, hint):

View File

@ -5,7 +5,7 @@ from structlog import get_logger
register = template.Library()
LOGGER = get_logger(__name__)
LOGGER = get_logger()
@register.simple_tag(takes_context=True)

View File

@ -3,7 +3,7 @@ from django import template
from structlog import get_logger
register = template.Library()
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def get_key_unique(context):

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.lib.config import CONFIG
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PassbookOAuthClientConfig(AppConfig):
"""passbook oauth_client config"""

View File

@ -11,7 +11,7 @@ from requests.exceptions import RequestException
from requests_oauthlib import OAuth1
from structlog import get_logger
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class BaseOAuthClient:

View File

@ -10,7 +10,7 @@ from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
from passbook.oauth_client.utils import user_get_or_create
from passbook.oauth_client.views.core import OAuthCallback
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class AzureADOAuth2Client(OAuth2Client):

View File

@ -9,7 +9,7 @@ from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
from passbook.oauth_client.utils import user_get_or_create
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
LOGGER = get_logger(__name__)
LOGGER = get_logger()
@MANAGER.source(kind=RequestKind.redirect, name='Discord')

View File

@ -5,7 +5,7 @@ from structlog import get_logger
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class RequestKind(Enum):
"""Enum of OAuth Request types"""

View File

@ -10,7 +10,7 @@ from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
from passbook.oauth_client.utils import user_get_or_create
from passbook.oauth_client.views.core import OAuthCallback, OAuthRedirect
LOGGER = get_logger(__name__)
LOGGER = get_logger()
@MANAGER.source(kind=RequestKind.redirect, name='reddit')

View File

@ -10,7 +10,7 @@ from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
from passbook.oauth_client.utils import user_get_or_create
from passbook.oauth_client.views.core import OAuthCallback
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class SupervisrOAuth2Client(OAuth2Client):

View File

@ -8,7 +8,7 @@ from passbook.oauth_client.source_types.manager import MANAGER, RequestKind
from passbook.oauth_client.utils import user_get_or_create
from passbook.oauth_client.views.core import OAuthCallback
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class TwitterOAuthClient(OAuthClient):

View File

@ -16,7 +16,7 @@ from passbook.lib.utils.reflection import app
from passbook.oauth_client.clients import get_client
from passbook.oauth_client.models import OAuthSource, UserOAuthSourceConnection
LOGGER = get_logger(__name__)
LOGGER = get_logger()
# pylint: disable=too-few-public-methods

View File

@ -14,7 +14,7 @@ from passbook.core.views.access import AccessMixin
from passbook.core.views.utils import LoadingView, PermissionDeniedView
from passbook.oauth_provider.models import OAuth2Provider
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PassbookAuthorizationLoadingView(LoginRequiredMixin, LoadingView):

View File

@ -4,7 +4,7 @@ from django.db.utils import InternalError, OperationalError, ProgrammingError
from django.urls import include, path
from structlog import get_logger
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PassbookOIDCProviderConfig(AppConfig):
"""passbook auth oidc provider app config"""

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.core.models import Application
from passbook.policy.engine import PolicyEngine
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def check_permissions(request, user, client):
"""Check permissions, used for

View File

@ -9,7 +9,7 @@ from passbook.core.auth.factor import AuthenticationFactor
from passbook.otp.forms import OTPVerifyForm
from passbook.otp.views import OTP_SETTING_UP_KEY, EnableView
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class OTPFactor(FormView, AuthenticationFactor):
"""OTP Factor View"""

View File

@ -23,7 +23,7 @@ from passbook.otp.utils import otpauth_url
OTP_SESSION_KEY = 'passbook_otp_key'
OTP_SETTING_UP_KEY = 'passbook_otp_setup'
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class UserSettingsView(LoginRequiredMixin, TemplateView):
"""View for user settings to control OTP"""

View File

@ -9,7 +9,7 @@ from structlog import get_logger
from passbook.core.models import Policy
from passbook.policy.struct import PolicyRequest, PolicyResult
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PasswordExpiryPolicy(Policy):

View File

@ -9,7 +9,7 @@ from structlog import get_logger
# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passbook.root.settings")
LOGGER = get_logger(__name__)
LOGGER = get_logger()
CELERY_APP = Celery('passbook')

View File

@ -8,7 +8,7 @@ from structlog import get_logger
from passbook.core.views import error
from passbook.lib.utils.reflection import get_apps
LOGGER = get_logger(__name__)
LOGGER = get_logger()
admin.autodiscover()
admin.site.login = RedirectView.as_view(pattern_name='passbook_core:auth-login')

View File

@ -6,7 +6,7 @@ from structlog import get_logger
from passbook.lib.config import CONFIG
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class PassbookSAMLIDPConfig(AppConfig):
"""passbook saml_idp app config"""

View File

@ -65,7 +65,7 @@ class Processor:
def __init__(self, remote):
self.name = remote.name
self._remote = remote
self._logger = get_logger(__name__)
self._logger = get_logger()
self._system_params['ISSUER'] = self._remote.issuer
self._logger.debug('processor configured')

View File

@ -9,7 +9,7 @@ from passbook.core.models import PropertyMapping, Provider
from passbook.lib.utils.reflection import class_to_path, path_to_class
from passbook.saml_idp.base import Processor
LOGGER = get_logger(__name__)
LOGGER = get_logger()
class SAMLProvider(Provider):

View File

@ -21,7 +21,7 @@ from passbook.policy.engine import PolicyEngine
from passbook.saml_idp import exceptions
from passbook.saml_idp.models import SAMLProvider
LOGGER = get_logger(__name__)
LOGGER = get_logger()
URL_VALIDATOR = URLValidator(schemes=('http', 'https'))

View File

@ -5,7 +5,7 @@ from structlog import get_logger
from passbook.lib.utils.template import render_to_string
from passbook.saml_idp.xml_signing import get_signature_xml, sign_with_signxml
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def _get_attribute_statement(params):

View File

@ -7,7 +7,7 @@ from structlog import get_logger
from passbook.lib.utils.template import render_to_string
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def sign_with_signxml(private_key, data, cert, reference_uri=None):

View File

@ -7,7 +7,7 @@ from structlog import get_logger
from passbook.core.models import User
from passbook.suspicious_policy.models import IPScore, UserScore
LOGGER = get_logger(__name__)
LOGGER = get_logger()
def get_remote_ip(request):