mirror of
https://github.com/Hopiu/django-notifications.git
synced 2026-03-16 21:30:24 +00:00
Fix some pylint issues
This commit is contained in:
parent
d971ce44e8
commit
87f82f89fd
6 changed files with 11 additions and 7 deletions
|
|
@ -23,8 +23,7 @@ repos:
|
|||
name: pylint
|
||||
entry: poetry run pylint
|
||||
language: system
|
||||
types: [python]
|
||||
args: ["--rcfile", "pyproject.toml"]
|
||||
args: ["--rcfile=pyproject.toml"]
|
||||
exclude: "migrations"
|
||||
|
||||
- repo: https://github.com/PyCQA/bandit
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ class NotificationAdmin(admin.ModelAdmin):
|
|||
return qs.prefetch_related("actor")
|
||||
|
||||
@admin.action(description=gettext_lazy("Mark selected notifications as unread"))
|
||||
def mark_unread(self, request: HttpRequest, queryset: NotificationQuerySet):
|
||||
def mark_unread(self, request: HttpRequest, queryset: NotificationQuerySet): # pylint: disable=unused-argument
|
||||
queryset.update(unread=True)
|
||||
|
||||
@admin.action(description=gettext_lazy("Mark selected notifications as read"))
|
||||
def mark_read(self, request: HttpRequest, queryset: NotificationQuerySet):
|
||||
def mark_read(self, request: HttpRequest, queryset: NotificationQuerySet): # pylint: disable=unused-argument
|
||||
queryset.update(unread=False)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# pylint: disable=too-many-lines
|
||||
import datetime
|
||||
|
||||
from django.conf import settings
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class NotificationSettings:
|
|||
notification_settings = NotificationSettings(NOTIFICATION_DEFAULTS)
|
||||
|
||||
|
||||
def reload_notification_settings(*args: Any, **kwargs: Any):
|
||||
def reload_notification_settings(*args: Any, **kwargs: Any): # pylint: disable=unused-argument
|
||||
setting = kwargs["setting"]
|
||||
if setting == "DJANGO_NOTIFICATIONS_CONFIG":
|
||||
notification_settings.reload()
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ def has_notification(user):
|
|||
# Requires vanilla-js framework - http://vanilla-js.com/
|
||||
@register.simple_tag
|
||||
def register_notify_callbacks(
|
||||
badge_class="live_notify_badge", # pylint: disable=too-many-arguments,missing-docstring
|
||||
badge_class="live_notify_badge",
|
||||
menu_class="live_notify_list",
|
||||
refresh_period=15,
|
||||
callbacks="",
|
||||
|
|
|
|||
|
|
@ -118,6 +118,9 @@ ignore = [
|
|||
]
|
||||
jobs = 0
|
||||
django-settings-module = "notifications.settings"
|
||||
fail-on=[
|
||||
"useless-suppression",
|
||||
]
|
||||
|
||||
[tool.pylint.DESIGN]
|
||||
max-locals = 20
|
||||
|
|
@ -125,6 +128,9 @@ max-args = 10
|
|||
max-parents = 10
|
||||
|
||||
[tool.pylint.'MESSAGES CONTROL']
|
||||
enable = [
|
||||
"useless-suppression",
|
||||
]
|
||||
disable = [
|
||||
"missing-function-docstring",
|
||||
"missing-class-docstring",
|
||||
|
|
|
|||
Loading…
Reference in a new issue