Skip to content

Commit

Permalink
Merge branch 'release/0.1.22'
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWillitts committed Jan 7, 2025
2 parents 151b3ad + d48a78a commit b042bda
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: tests/etc/user-*

repos:
- repo: https://github.com/PyCQA/bandit
rev: 1.7.10
rev: 1.8.0
hooks:
- id: bandit
args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from django.urls import reverse
from django.utils.translation import gettext as _
from edc_constants.constants import NEW
from edc_utils import truncate_string

from ..models import QaReportLog
from ..utils import truncate_string
from .list_filters import NoteStatusListFilter


Expand Down
10 changes: 0 additions & 10 deletions edc_qareports/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,6 @@ def read_unmanaged_model_sql(
return sql.replace("uuid()", uuid_func)


def truncate_string(string: str, max_length: int) -> str:
"""Strips string of leading/trailing whitespace and truncates
if > `max_length`.
"""
string = string.strip()
if len(string) > max_length:
return string[: max_length - 1].strip() + "…"
return string


def get_qareports_codenames(app_name: str, *note_models: str) -> list[str]:
warn("This function has been deprecated. Use get_app_codenames.", DeprecationWarning, 2)
return get_app_codenames(app_name)

0 comments on commit b042bda

Please sign in to comment.