Skip to content

Conversation

@bctiemann
Copy link
Contributor

Closes: #17936

@bctiemann bctiemann marked this pull request as draft October 28, 2025 18:26
@bctiemann bctiemann marked this pull request as ready for review October 29, 2025 20:25
@bctiemann bctiemann requested review from a team and jeremystretch and removed request for a team October 29, 2025 20:25
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two serializers with generic foreign keys where GFKSerializerField is not being employed, presumably due to variations in the resolution logic.

  • ObjectChangeSerializer.changed_object: Suggest we replace the SerializerMethodField with GFKSerializerField, and expose object_repr as a regular read-only field. IMO this cleaner than the current fallback behavior.
  • EventRuleSerializer.action_object: I don't think the custom logic under get_action_object() is necessary anymore as there is a now a Script model: The automatic resolution should work.

@bctiemann
Copy link
Contributor Author

Added those two; tested successfully, works nice. Added ObjectChangeSerializer.object_repr as a read-only CharField.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants