зеркало из https://github.com/mozilla/normandy.git
b048cb2d2b
2116: Remove more aliases r=mythmon a=glasserc Refs #1863. This PR is mostly structured as individual commits which remove one property at a time, converting existing uses to be either `.approved_revision` or `.latest_revision` based on my best guess about what is appropriate in each case. The main point of contention here is the serializers, which use these properties more-or-less explicitly. The v1 serializers are mostly used for signed/enabled recipes, so the cleanest way to fix this would be to restrict their use to that. However, the tests indicate that the v1 API can be/still is used with non-enabled recipes. I'm not expert enough in Django/DRF to figure out how to remove that stuff surgically, so instead this PR takes the approach of moving the existing `current_revision` logic (i.e. `approved_revision or latest_revision`) into the RecipeSerializer on the assumption that it's only used in read-only circumstances so it's probably fine. The `MinimalRecipeSerializer` is converted to only use `approved_revision` as it is mostly intended for signed recipes which must be approved. These changes are perhaps not the cleanest possible approach but I thought changing the v1 API was outside the scope of the changes I wanted to make (these changes already being substantial). Co-authored-by: Ethan Glasser-Camp <ethan@betacantrips.com> |
||
---|---|---|
.. | ||
base | ||
capabilities | ||
health | ||
recipes | ||
selfrepair | ||
studies | ||
__init__.py | ||
conftest.py | ||
schema.py | ||
settings.py | ||
urls.py | ||
wsgi.py |