Configures ruff as the one stop linter and resolves warnings it raised

This commit is contained in:
Trenton H
2023-03-28 09:39:30 -07:00
parent 5869467db3
commit ce41ac9158
110 changed files with 507 additions and 491 deletions

View File

@@ -269,7 +269,7 @@ class Document(ModelWithOwner):
MinValueValidator(ARCHIVE_SERIAL_NUMBER_MIN),
],
help_text=_(
"The position of this document in your physical document " "archive.",
"The position of this document in your physical document archive.",
),
)
@@ -470,6 +470,9 @@ class SavedViewFilterRule(models.Model):
verbose_name = _("filter rule")
verbose_name_plural = _("filter rules")
def __str__(self) -> str:
return f"SavedViewFilterRule: {self.rule_type} : {self.value}"
# TODO: why is this in the models file?
# TODO: how about, what is this and where is it documented?
@@ -483,7 +486,7 @@ class FileInfo:
(
"created-title",
re.compile(
r"^(?P<created>\d{8}(\d{6})?Z) - " r"(?P<title>.*)$",
r"^(?P<created>\d{8}(\d{6})?Z) - (?P<title>.*)$",
flags=re.IGNORECASE,
),
),
@@ -634,6 +637,9 @@ class PaperlessTask(models.Model):
),
)
def __str__(self) -> str:
return f"Task {self.task_id}"
class Note(models.Model):
note = models.TextField(