wbcompliance 1.59.16__py2.py3-none-any.whl → 1.60.1__py2.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.
- wbcompliance/factories/risk_management/backends.py +1 -2
- wbcompliance/factories/risk_management/checks.py +2 -2
- wbcompliance/factories/risk_management/rules.py +2 -2
- wbcompliance/filters/risk_management/checks.py +3 -2
- wbcompliance/filters/risk_management/incidents.py +3 -2
- wbcompliance/filters/risk_management/rules.py +2 -1
- wbcompliance/filters/risk_management/tables.py +1 -1
- wbcompliance/locale/de/LC_MESSAGES/django.po +195 -189
- wbcompliance/locale/en/LC_MESSAGES/django.po +195 -188
- wbcompliance/locale/fr/LC_MESSAGES/django.po +195 -189
- wbcompliance/models/compliance_form.py +1 -3
- wbcompliance/models/compliance_task.py +1 -3
- wbcompliance/models/compliance_type.py +6 -11
- wbcompliance/models/risk_management/incidents.py +2 -5
- wbcompliance/models/risk_management/rules.py +2 -2
- wbcompliance/serializers/risk_management/checks.py +2 -2
- wbcompliance/serializers/risk_management/incidents.py +1 -1
- wbcompliance/serializers/risk_management/rules.py +2 -2
- wbcompliance/tasks.py +27 -1
- wbcompliance/tests/mixins.py +0 -2
- wbcompliance/tests/risk_management/models/test_incidents.py +0 -3
- wbcompliance/tests/test_tasks.py +28 -0
- wbcompliance/viewsets/compliance_form.py +1 -3
- wbcompliance/viewsets/risk_management/checks.py +0 -3
- wbcompliance/viewsets/risk_management/incidents.py +1 -4
- wbcompliance/viewsets/risk_management/rules.py +0 -3
- {wbcompliance-1.59.16.dist-info → wbcompliance-1.60.1.dist-info}/METADATA +1 -1
- {wbcompliance-1.59.16.dist-info → wbcompliance-1.60.1.dist-info}/RECORD +29 -28
- {wbcompliance-1.59.16.dist-info → wbcompliance-1.60.1.dist-info}/WHEEL +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
from typing import Generator
|
|
2
2
|
|
|
3
|
-
from django.contrib.auth import get_user_model
|
|
4
3
|
from django.contrib.contenttypes.models import ContentType
|
|
5
4
|
from faker import Faker
|
|
6
5
|
from wbcore import serializers as wb_serializers
|
|
6
|
+
from wbcore.contrib.authentication.models.users import User
|
|
7
7
|
|
|
8
8
|
from wbcompliance.models.risk_management import backend
|
|
9
9
|
|
|
10
|
-
User = get_user_model()
|
|
11
10
|
fake = Faker()
|
|
12
11
|
|
|
13
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import factory
|
|
2
|
-
from django.contrib.auth import get_user_model
|
|
3
2
|
from django.contrib.contenttypes.models import ContentType
|
|
3
|
+
from wbcore.contrib.authentication.models.users import User
|
|
4
4
|
|
|
5
5
|
from wbcompliance.models.risk_management.checks import RiskCheck
|
|
6
6
|
|
|
@@ -8,7 +8,7 @@ from wbcompliance.models.risk_management.checks import RiskCheck
|
|
|
8
8
|
class RiskCheckFactory(factory.django.DjangoModelFactory):
|
|
9
9
|
rule = factory.SubFactory("wbcompliance.factories.risk_management.rules.RiskRuleFactory")
|
|
10
10
|
evaluation_date = factory.Faker("date_object")
|
|
11
|
-
checked_object_content_type = factory.LazyAttribute(lambda o: ContentType.objects.get_for_model(
|
|
11
|
+
checked_object_content_type = factory.LazyAttribute(lambda o: ContentType.objects.get_for_model(User))
|
|
12
12
|
checked_object_id = 1
|
|
13
13
|
|
|
14
14
|
@factory.post_generation
|
|
@@ -3,13 +3,13 @@ import random
|
|
|
3
3
|
from datetime import date
|
|
4
4
|
|
|
5
5
|
import factory
|
|
6
|
-
from django.contrib.auth import get_user_model
|
|
7
6
|
from django.contrib.contenttypes.models import ContentType
|
|
8
7
|
from django.core.serializers.json import DjangoJSONEncoder
|
|
9
8
|
from faker import Faker
|
|
10
9
|
from guardian.utils import get_anonymous_user
|
|
11
10
|
from psycopg.types.range import NumericRange
|
|
12
11
|
from wbcore.contrib.authentication.factories import UserFactory
|
|
12
|
+
from wbcore.contrib.authentication.models.users import User
|
|
13
13
|
|
|
14
14
|
from wbcompliance.models.risk_management.rules import (
|
|
15
15
|
RiskRule,
|
|
@@ -95,7 +95,7 @@ class RuleThresholdFactory(factory.django.DjangoModelFactory):
|
|
|
95
95
|
|
|
96
96
|
class RuleCheckedObjectRelationshipFactory(factory.django.DjangoModelFactory):
|
|
97
97
|
rule = factory.SubFactory("wbcompliance.factories.risk_management.RiskRuleFactory")
|
|
98
|
-
checked_object_content_type = factory.LazyAttribute(lambda o: ContentType.objects.get_for_model(
|
|
98
|
+
checked_object_content_type = factory.LazyAttribute(lambda o: ContentType.objects.get_for_model(User))
|
|
99
99
|
checked_object_id = 1
|
|
100
100
|
|
|
101
101
|
class Meta:
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from wbcore import filters as wb_filters
|
|
2
|
+
from wbcore.contrib.content_type.filters import MultipleChoiceContentTypeFilter
|
|
2
3
|
|
|
3
4
|
from wbcompliance.models.risk_management import RiskCheck
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
class RiskCheckFilterSet(wb_filters.FilterSet):
|
|
7
|
-
checked_objects =
|
|
8
|
+
checked_objects = MultipleChoiceContentTypeFilter(
|
|
8
9
|
label="Triggerers",
|
|
9
10
|
field_name="checked_objects",
|
|
10
11
|
object_id_label="checked_object_id",
|
|
@@ -12,7 +13,7 @@ class RiskCheckFilterSet(wb_filters.FilterSet):
|
|
|
12
13
|
distinct=True,
|
|
13
14
|
hidden=True,
|
|
14
15
|
)
|
|
15
|
-
activators =
|
|
16
|
+
activators = MultipleChoiceContentTypeFilter(
|
|
16
17
|
label="Activators",
|
|
17
18
|
field_name="activators",
|
|
18
19
|
object_id_label="activator_id",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from django.db.models import Q
|
|
2
2
|
from django.utils.translation import gettext_lazy as _
|
|
3
3
|
from wbcore import filters as wb_filters
|
|
4
|
+
from wbcore.contrib.content_type.filters import MultipleChoiceContentTypeFilter
|
|
4
5
|
|
|
5
6
|
from wbcompliance.models.risk_management import (
|
|
6
7
|
CheckedObjectIncidentRelationship,
|
|
@@ -39,7 +40,7 @@ class RiskIncidentFilterSet(wb_filters.FilterSet):
|
|
|
39
40
|
label_key=RiskIncidentType.get_representation_label_key(),
|
|
40
41
|
initial=get_default_severity,
|
|
41
42
|
)
|
|
42
|
-
checked_object_relationships =
|
|
43
|
+
checked_object_relationships = MultipleChoiceContentTypeFilter(
|
|
43
44
|
label="Checked Objects",
|
|
44
45
|
field_name="checked_object_relationships",
|
|
45
46
|
object_id_label="checked_object_relationships__rule_check__checked_object_id",
|
|
@@ -80,7 +81,7 @@ class CheckedObjectIncidentRelationshipFilterSet(wb_filters.FilterSet):
|
|
|
80
81
|
checked_object = wb_filters.CharFilter(
|
|
81
82
|
method="filter_checked_object", field_name="checked_object", lookup_expr="icontains"
|
|
82
83
|
)
|
|
83
|
-
checked_object_relationships =
|
|
84
|
+
checked_object_relationships = MultipleChoiceContentTypeFilter(
|
|
84
85
|
label="Checked Objects",
|
|
85
86
|
field_name="checked_object_relationships",
|
|
86
87
|
object_id_label="rule_check__checked_object_id",
|
|
@@ -2,6 +2,7 @@ from django.db.models import Count, F, OuterRef, Q, Subquery
|
|
|
2
2
|
from django.db.models.functions import Coalesce
|
|
3
3
|
from django.utils.translation import gettext_lazy as _
|
|
4
4
|
from wbcore import filters as wb_filters
|
|
5
|
+
from wbcore.contrib.content_type.filters import MultipleChoiceContentTypeFilter
|
|
5
6
|
from wbcore.contrib.directory.models import Person
|
|
6
7
|
|
|
7
8
|
from wbcompliance.models.risk_management import RiskRule, RuleThreshold
|
|
@@ -11,7 +12,7 @@ from .utils import get_default_handler
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
class RiskRuleFilterSet(wb_filters.FilterSet):
|
|
14
|
-
checked_object_relationships =
|
|
15
|
+
checked_object_relationships = MultipleChoiceContentTypeFilter(
|
|
15
16
|
label="Checked Objects",
|
|
16
17
|
field_name="checked_object_relationships",
|
|
17
18
|
distinct=True,
|
|
@@ -36,7 +36,7 @@ class RiskManagementIncidentFilter(wb_filters.FilterSet):
|
|
|
36
36
|
required=True,
|
|
37
37
|
method="filter_checked_object_content_type",
|
|
38
38
|
queryset=ContentType.objects.all(),
|
|
39
|
-
endpoint="wbcore:contenttyperepresentation-list",
|
|
39
|
+
endpoint="wbcore:content_type:contenttyperepresentation-list",
|
|
40
40
|
value_key="id",
|
|
41
41
|
label_key="{{app_label}} | {{model}}",
|
|
42
42
|
label=_("Checked Object Type"),
|