From 71749e030ed5e9438198858bf7478a23c10acccf Mon Sep 17 00:00:00 2001 From: erikvw Date: Fri, 16 Aug 2024 08:12:59 -0500 Subject: [PATCH] update FEEDBACK to PENDING on Note, remove user_may_view_other_sites=True --- .../admin/qa_report_log_summary_admin.py | 1 - .../migrations/0017_auto_20240816_0256.py | 24 +++++++++++++++++++ .../qa_report_modeladmin_mixin.py | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 edc_qareports/migrations/0017_auto_20240816_0256.py diff --git a/edc_qareports/admin/qa_report_log_summary_admin.py b/edc_qareports/admin/qa_report_log_summary_admin.py index a38ddef..221dce6 100644 --- a/edc_qareports/admin/qa_report_log_summary_admin.py +++ b/edc_qareports/admin/qa_report_log_summary_admin.py @@ -17,7 +17,6 @@ class QaReportLogSummaryAdmin( admin.ModelAdmin, ): ordering = ["-last_accessed"] - user_may_view_other_sites = True list_display = ( "username", diff --git a/edc_qareports/migrations/0017_auto_20240816_0256.py b/edc_qareports/migrations/0017_auto_20240816_0256.py new file mode 100644 index 0000000..4dde420 --- /dev/null +++ b/edc_qareports/migrations/0017_auto_20240816_0256.py @@ -0,0 +1,24 @@ +# Generated by Django 5.1 on 2024-08-15 23:56 + +from django.db import migrations +from django.db.migrations import RunPython +from edc_constants.constants import FEEDBACK, PENDING + + +def update_status(apps, schema_editor): + for model_cls in apps.get_models(): + if getattr(model_cls, "status", None): + print( + f"Updated `{model_cls._meta.label_lower}.status` from `{FEEDBACK}` " + f"to `{PENDING}`." + ) + model_cls.objects.filter(status=FEEDBACK).update(status=PENDING) + + +class Migration(migrations.Migration): + + dependencies = [ + ("edc_qareports", "0016_alter_note_options_alter_qareportlog_options"), + ] + + operations = [RunPython(update_status)] diff --git a/edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py b/edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py index 69b97ee..bf7dbc2 100644 --- a/edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py +++ b/edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py @@ -22,7 +22,7 @@ class QaReportModelAdminMixin: qa_report_log_enabled = True qa_report_list_display_insert_pos = 3 - + list_per_page = 25 note_model = "edc_qareports.note" note_status_list_filter = NoteStatusListFilter note_template = "edc_qareports/columns/notes_column.html"