Skip to content

Commit

Permalink
feat(disclaimers): Split disclaimers
Browse files Browse the repository at this point in the history
  • Loading branch information
kiblik committed Sep 12, 2024
1 parent ea4e733 commit ad4c8c0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
38 changes: 38 additions & 0 deletions dojo/db_migrations/0215_system_settings_disclaimer_notif.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 5.0.8 on 2024-09-12 18:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dojo', '0214_test_type_dynamically_generated'),
]

operations = [
migrations.RenameField(
model_name='system_settings',
old_name='disclaimer',
new_name='disclaimer_notifications',
),
migrations.AlterField(
model_name='system_settings',
name='disclaimer_notifications',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer on all notifications', max_length=3000, verbose_name='Custom Disclaimer for Notifications'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_reports',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer on generated reports', max_length=5000, verbose_name='Custom Disclaimer for Reports'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_notes',
field=models.TextField(blank=True, default='', help_text='Include this custom disclaimer next to input form for notes', max_length=3000, verbose_name='Custom Disclaimer for Notes'),
),
migrations.AddField(
model_name='system_settings',
name='disclaimer_reports_forced',
field=models.BooleanField(default=False, help_text="Disclaimer will be added to all reports even if user didn't selected 'Include disclaimer'.", verbose_name='Force to add disclaimer reports'),
),
]
17 changes: 14 additions & 3 deletions dojo/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,20 @@ class System_Settings(models.Model):
help_text=_("Enable anyone with a link to the survey to answer a survey"),
)
credentials = models.TextField(max_length=3000, blank=True)
disclaimer = models.TextField(max_length=3000, default="", blank=True,
verbose_name=_("Custom Disclaimer"),
help_text=_("Include this custom disclaimer on all notifications and generated reports"))
disclaimer_notifications = models.TextField(max_length=3000, default="", blank=True,
verbose_name=_("Custom Disclaimer for Notifications"),
help_text=_("Include this custom disclaimer on all notifications"))
disclaimer_reports = models.TextField(max_length=5000, default="", blank=True,
verbose_name=_("Custom Disclaimer for Reports"),
help_text=_("Include this custom disclaimer on generated reports"))
disclaimer_reports_forced = models.BooleanField(
default=False,
blank=False,
verbose_name=_("Force to add disclaimer reports"),
help_text=_("Disclaimer will be added to all reports even if user didn't selected 'Include disclaimer'."))
disclaimer_notes = models.TextField(max_length=3000, default="", blank=True,
verbose_name=_("Custom Disclaimer for Notes"),
help_text=_("Include this custom disclaimer next to input form for notes"))
risk_acceptance_form_default_days = models.IntegerField(null=True, blank=True, default=180, help_text=_("Default expiry period for risk acceptance form."))
risk_acceptance_notify_before_expiration = models.IntegerField(null=True, blank=True, default=10,
verbose_name=_("Risk acceptance expiration heads up days"), help_text=_("Notify X days before risk acceptance expires. Leave empty to disable."))
Expand Down

0 comments on commit ad4c8c0

Please sign in to comment.