Skip to content

Commit

Permalink
Merge branch 'release/1.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Jan 21, 2025
2 parents f33a680 + e0c19da commit c37c3c5
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 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.2
hooks:
- id: bandit
args:
Expand Down
4 changes: 4 additions & 0 deletions edc_qareports/model_mixins/qa_report_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ def recreate_db_view(cls, drop: bool | None = None, verbose: bool | None = None)
from intecomm_reports.models import Vl
Vl.recreate_db_view()
Also, could do something like this (replace details as required):
CREATE USER 'edc-effect-live'@'10.131.23.168' IDENTIFIED BY 'xxxxxx';
GRANT SELECT ON effect_prod.* to 'edc-effect-live'@'10.131.23.168';
"""
drop = True if drop is None else drop
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def dashboard(self, obj=None, label=None) -> str:
),
)
context = dict(title=_("Go to subject's dashboard"), url=dashboard_url, label=label)
return render_to_string("dashboard_button.html", context=context)
return render_to_string("edc_subject_dashboard/dashboard_button.html", context=context)

@staticmethod
def crf_admin_site_name(crf_model_cls) -> str:
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a title="{{ label|default:"Add CRF"}}" role="button" class="button" href="{{ url }}">Add&nbsp;CRF</a>
<a title="{{ label|default:"Add CRF"}}" role="button" class="button" style="white-space: nowrap" href="{{ url }}">Add&nbsp;CRF</a>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<a title="{{ title|default:"Change CRF"}}" role="button" class="button" href="{{ url }}">{{ label|default:"Change&nbsp;CRF" }}</a>
<a title="{{ title|default:"Change CRF"}}" role="button" class="button" style="white-space: nowrap" href="{{ url }}">{{ label|default:"Change&nbsp;CRF" }}</a>
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 c37c3c5

Please sign in to comment.