-
-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* starting playbooks Signed-off-by: 0ssigeno <s.berni@certego.net> * Not starting Signed-off-by: 0ssigeno <s.berni@certego.net> * Fix migration Signed-off-by: 0ssigeno <s.berni@certego.net> * Prettier Signed-off-by: 0ssigeno <s.berni@certego.net> * Fix Signed-off-by: 0ssigeno <s.berni@certego.net> --------- Signed-off-by: 0ssigeno <s.berni@certego.net>
- Loading branch information
Showing
8 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
api_app/playbooks_manager/migrations/0037_playbookconfig_starting.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,20 @@ | ||
# Generated by Django 4.2.11 on 2024-05-07 13:54 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("playbooks_manager", "0036_static_analyzer_remove_visualizer"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="playbookconfig", | ||
name="starting", | ||
field=models.BooleanField( | ||
default=True, | ||
help_text="If False, the playbook can only be executed by pivots", | ||
), | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
api_app/playbooks_manager/migrations/0038_playbooks_not_starting.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,29 @@ | ||
# Generated by Django 4.2.11 on 2024-05-07 13:54 | ||
|
||
from django.db import migrations | ||
|
||
playbooks_to_change = ["Abuse_IP"] | ||
|
||
|
||
def migrate(apps, schema_editor): | ||
PlaybookConfig = apps.get_model("playbooks_manager", "PlaybookConfig") | ||
for pc in PlaybookConfig.objects.filter(name__in=playbooks_to_change): | ||
pc.starting = False | ||
pc.save() | ||
|
||
|
||
def reverse_migrate(apps, schema_editor): | ||
PlaybookConfig = apps.get_model("playbooks_manager", "PlaybookConfig") | ||
for pc in PlaybookConfig.objects.filter(name__in=playbooks_to_change): | ||
pc.starting = True | ||
pc.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("playbooks_manager", "0037_playbookconfig_starting"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate, reverse_migrate), | ||
] |
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
24 changes: 24 additions & 0 deletions
24
authentication/migrations/0006_alter_userprofile_company_name_and_more.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,24 @@ | ||
# Generated by Django 4.2.11 on 2024-05-07 13:54 | ||
|
||
import django.core.validators | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('authentication', '0005_create_profiles'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='userprofile', | ||
name='company_name', | ||
field=models.CharField(blank=True, default='', max_length=32, validators=[django.core.validators.MinLengthValidator(3)]), | ||
), | ||
migrations.AlterField( | ||
model_name='userprofile', | ||
name='company_role', | ||
field=models.CharField(blank=True, default='', max_length=32, validators=[django.core.validators.MinLengthValidator(3)]), | ||
), | ||
] |
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