Skip to content

Commit c204324

Browse files
authored
fix: change the default value of ruleset_stats of activation to empty string (#1116)
1 parent 6cbd379 commit c204324

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/aap_eda/api/serializers/activation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ class ActivationReadSerializer(serializers.ModelSerializer):
516516
rules_count = serializers.IntegerField()
517517
rules_fired_count = serializers.IntegerField()
518518
ruleset_stats = YAMLSerializerField(
519+
required=True,
519520
sort_keys=False,
520521
help_text="The stat information about the activation",
521522
)
@@ -629,7 +630,7 @@ def to_representation(self, activation):
629630
activation.ruleset_stats
630631
)
631632
if activation.ruleset_stats
632-
else None
633+
else ""
633634
)
634635

635636
return {

tests/integration/api/test_activation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ def test_retrieve_activation(
413413
assert response.status_code == status.HTTP_200_OK
414414
data = response.data
415415
assert_activation_base_data(data, default_activation)
416-
assert data["ruleset_stats"] is None
416+
assert data["ruleset_stats"] == ""
417417
if default_activation.project:
418418
assert data["project"]["id"] == default_activation.project.id
419419
else:

0 commit comments

Comments
 (0)