Skip to content

Commit

Permalink
feat: add ahjo validation error message (#3410)
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast authored Oct 8, 2024
1 parent 26453a8 commit d7c6ee4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
class AhjoStatusSerializer(serializers.ModelSerializer):
class Meta:
model = AhjoStatus
fields = ["modified_at", "error_from_ahjo"]
fields = ["modified_at", "error_from_ahjo", "validation_error_from_ahjo"]
Original file line number Diff line number Diff line change
Expand Up @@ -1957,9 +1957,10 @@ def get_latest_ahjo_error(self, obj) -> Union[Dict, None]:
return None
data = AhjoStatusSerializer(status).data
if data["error_from_ahjo"] is None:
data = None
else:
data.update({"status": status.status})
if data["validation_error_from_ahjo"] is None:
data = None
else:
data["error_from_ahjo"] = data["validation_error_from_ahjo"]
return data

handled_by_ahjo_automation = serializers.BooleanField(
Expand Down

0 comments on commit d7c6ee4

Please sign in to comment.