-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
69 additions
and
56 deletions.
There are no files selected for viewing
38 changes: 0 additions & 38 deletions
38
dojo/db_migrations/0218_system_settings_disclaimer_notif.py
This file was deleted.
Oops, something went wrong.
37 changes: 27 additions & 10 deletions
37
dojo/db_migrations/0219_system_settings_disclaimer_notif.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,38 @@ | ||
# Generated by Django 5.0.8 on 2024-09-12 18:22 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def copy_notif_field(apps, schema_editor): | ||
system_settings_model = apps.get_model('dojo', 'System_Settings').objects.get() | ||
if system_settings_model.disclaimer_notifications: | ||
system_settings_model.disclaimer_reports = system_settings_model.disclaimer_notifications | ||
system_settings_model.save() | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dojo', '0218_system_settings_disclaimer_notif'), | ||
('dojo', '0218_system_settings_enforce_verified_status_and_more'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(copy_notif_field), | ||
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'), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
dojo/db_migrations/0220_system_settings_disclaimer_notif.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated by Django 5.0.8 on 2024-09-12 18:22 | ||
|
||
from django.db import migrations | ||
|
||
|
||
def copy_notif_field(apps, schema_editor): | ||
system_settings_model = apps.get_model('dojo', 'System_Settings').objects.get() | ||
if system_settings_model.disclaimer_notifications: | ||
system_settings_model.disclaimer_reports = system_settings_model.disclaimer_notifications | ||
system_settings_model.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dojo', '0219_system_settings_disclaimer_notif'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(copy_notif_field), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters