Skip to content

Commit

Permalink
fix: change the default value of ruleset_stats of activation to empty…
Browse files Browse the repository at this point in the history
… string (#1116)
  • Loading branch information
hsong-rh authored Oct 22, 2024
1 parent 6cbd379 commit c204324
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/aap_eda/api/serializers/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ class ActivationReadSerializer(serializers.ModelSerializer):
rules_count = serializers.IntegerField()
rules_fired_count = serializers.IntegerField()
ruleset_stats = YAMLSerializerField(
required=True,
sort_keys=False,
help_text="The stat information about the activation",
)
Expand Down Expand Up @@ -629,7 +630,7 @@ def to_representation(self, activation):
activation.ruleset_stats
)
if activation.ruleset_stats
else None
else ""
)

return {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/api/test_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def test_retrieve_activation(
assert response.status_code == status.HTTP_200_OK
data = response.data
assert_activation_base_data(data, default_activation)
assert data["ruleset_stats"] is None
assert data["ruleset_stats"] == ""
if default_activation.project:
assert data["project"]["id"] == default_activation.project.id
else:
Expand Down

0 comments on commit c204324

Please sign in to comment.