firefighter-incident 0.0.12__py3-none-any.whl → 0.0.13__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
firefighter/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.0.12'
21
- __version_tuple__ = version_tuple = (0, 0, 12)
20
+ __version__ = version = '0.0.13'
21
+ __version_tuple__ = version_tuple = (0, 0, 13)
@@ -0,0 +1,67 @@
1
+ import logging
2
+
3
+ from django.db import migrations
4
+
5
+ logger = logging.getLogger(__name__)
6
+
7
+
8
+ def set_security_components_to_private(apps, schema_editor):
9
+ """Set all components belonging to the Security group as private, except 'Bot management & rate limiting & WAF'."""
10
+ Component = apps.get_model("incidents", "Component")
11
+ Group = apps.get_model("incidents", "Group")
12
+
13
+ try:
14
+ security_group = Group.objects.get(name="Security")
15
+ components = Component.objects.filter(group=security_group).exclude(
16
+ name="Bot management & rate limiting & WAF"
17
+ )
18
+
19
+ updated_count = 0
20
+ for component in components:
21
+ if not component.private:
22
+ logger.info(f"Setting component '{component.name}' to private")
23
+ component.private = True
24
+ component.save()
25
+ updated_count += 1
26
+
27
+ logger.info(f"Updated {updated_count} Security components to private")
28
+ except Group.DoesNotExist:
29
+ logger.warning("Security group not found, skipping migration")
30
+
31
+
32
+ def revert_security_components_to_public(apps, schema_editor):
33
+ """Revert all components belonging to the Security group to public, except 'Bot management & rate limiting & WAF'."""
34
+ Component = apps.get_model("incidents", "Component")
35
+ Group = apps.get_model("incidents", "Group")
36
+
37
+ try:
38
+ security_group = Group.objects.get(name="Security")
39
+ components = Component.objects.filter(group=security_group).exclude(
40
+ name="Bot management & rate limiting & WAF"
41
+ )
42
+
43
+ updated_count = 0
44
+ for component in components:
45
+ if component.private:
46
+ logger.info(f"Setting component '{component.name}' to public")
47
+ component.private = False
48
+ component.save()
49
+ updated_count += 1
50
+
51
+ logger.info(f"Reverted {updated_count} Security components to public")
52
+ except Group.DoesNotExist:
53
+ logger.warning("Security group not found, skipping reverse migration")
54
+
55
+
56
+ class Migration(migrations.Migration):
57
+
58
+ dependencies = [
59
+ ("incidents", "0018_update_impactlevel_names"),
60
+ ]
61
+
62
+ operations = [
63
+ migrations.RunPython(
64
+ set_security_components_to_private,
65
+ revert_security_components_to_public
66
+ ),
67
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: firefighter-incident
3
- Version: 0.0.12
3
+ Version: 0.0.13
4
4
  Summary: Incident Management tool made for Slack using Django
5
5
  Project-URL: Repository, https://github.com/ManoManoTech/firefighter-incident
6
6
  Project-URL: Documentation, https://manomanotech.github.io/firefighter-incident/latest/
@@ -6,7 +6,7 @@ gunicorn.conf.py,sha256=vHsTGjaKOr8FDMp6fTKYTX4AtokmPgYvvt5Mr0Q6APc,273
6
6
  main.py,sha256=CsbprHoOYhjCLpTJmq9Z_aRYFoFgWxoz2pDLuwm8Eqg,1558
7
7
  manage.py,sha256=5ivHGD13C6nJ8QvltKsJ9T9akA5he8da70HLWaEP3k8,689
8
8
  firefighter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- firefighter/_version.py,sha256=yXPCLHqHWroxl6PYku74xz7jqX7Xrf288eRJfEDWwBo,513
9
+ firefighter/_version.py,sha256=qGWOla3klVyqOm_YOKHZibHNWUcX0sSXl2bsaNtaX9E,513
10
10
  firefighter/api/__init__.py,sha256=JQW0Bv6xwGqy7ioxx3h6UGMzkkJ4DntDpbvV1Ncgi8k,136
11
11
  firefighter/api/admin.py,sha256=x9Ysy-GiYjb0rynmFdS9g56e6n24fkN0ouGy5QD9Yrc,4629
12
12
  firefighter/api/apps.py,sha256=P5uU1_gMrDfzurdMbfqw1Bnb2uNKKcMq17WBPg2sLhc,204
@@ -163,6 +163,7 @@ firefighter/incidents/migrations/0015_update_impact_level.py,sha256=OQVTVrWvQ1or
163
163
  firefighter/incidents/migrations/0016_update_business_incidents_and_level.py,sha256=O5AL9twmjstSw44ndJ2-Og6dpKreReXVw_brpQb-t0w,3600
164
164
  firefighter/incidents/migrations/0017_reorder_impact_types.py,sha256=7NN2KjcDRHNInXyEh8YKZli2LWT_i0UHXBbI21dXB6w,877
165
165
  firefighter/incidents/migrations/0018_update_impactlevel_names.py,sha256=E37png_LiXABzuXk-vmxTgikw8YmULODkiytE2mkxT0,2227
166
+ firefighter/incidents/migrations/0019_set_security_components_private.py,sha256=hgQX2Yc7WIIdZVciQfjtQrXWYr1PpyFRc26vqBReDoA,2334
166
167
  firefighter/incidents/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
167
168
  firefighter/incidents/models/__init__.py,sha256=dCNP-zRYNNDOZB3JDDWp7vCl084Jh6RgDT_iP57RkOY,862
168
169
  firefighter/incidents/models/component.py,sha256=7GyXKNFk1MZns6RUGLpkNw5u6He7H9N1LexzXbG4sBM,7445
@@ -448,8 +449,8 @@ firefighter_tests/test_slack/views/modals/test_open.py,sha256=z3lvAPOXCUSt7i_9jW
448
449
  firefighter_tests/test_slack/views/modals/test_send_sos.py,sha256=_rE6jD-gOzcGyhlY0R9GzlGtPx65oOOguJYdENgxtLc,1289
449
450
  firefighter_tests/test_slack/views/modals/test_status.py,sha256=oQzPfwdg2tkbo9nfkO1GfS3WydxqSC6vy1AZjZDKT30,2226
450
451
  firefighter_tests/test_slack/views/modals/test_update_status.py,sha256=Y8Oa_fraj1vtaGig9Y28_6tOWvMrRPS-wyg3rY-DHBk,39380
451
- firefighter_incident-0.0.12.dist-info/METADATA,sha256=246jLZgtEuOVdQ5X7fKsv38jrGzyvFsyrILgQ4yjATg,5488
452
- firefighter_incident-0.0.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
453
- firefighter_incident-0.0.12.dist-info/entry_points.txt,sha256=c13meJbv7YNmYz7MipMOQwzQ5IeFOPXUBYAJ44XMQsM,61
454
- firefighter_incident-0.0.12.dist-info/licenses/LICENSE,sha256=krRiGp-a9-1nH1bWpBEdxyTKLhjLmn6DMVVoIb0zF90,1087
455
- firefighter_incident-0.0.12.dist-info/RECORD,,
452
+ firefighter_incident-0.0.13.dist-info/METADATA,sha256=EF5mZjZdNgypTxb3lZVVcu1HAxfEVPDZ4mSvJoyyYvI,5488
453
+ firefighter_incident-0.0.13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
454
+ firefighter_incident-0.0.13.dist-info/entry_points.txt,sha256=c13meJbv7YNmYz7MipMOQwzQ5IeFOPXUBYAJ44XMQsM,61
455
+ firefighter_incident-0.0.13.dist-info/licenses/LICENSE,sha256=krRiGp-a9-1nH1bWpBEdxyTKLhjLmn6DMVVoIb0zF90,1087
456
+ firefighter_incident-0.0.13.dist-info/RECORD,,