-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build details page: normalize/trim command paths (second attempt)
Continuation of the work done in #9815 that didn't work as we expected. We weren't saving the commands properly when hitting the API since `serializers.SerializerMethodField` is a read-only field. This commit fixes this problem by using a different Serializer depending if it's a GET request or not, and if it's made by an Admin or not. It overrides the method `BuildViewSet.get_serializer_class` to manage these different cases and return the proper serializer. Done on top of #9815 to be sure the tests for saving commands are passing.
- Loading branch information
Showing
2 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters