addons-server
addons-server copied to clipboard
Write Promoted Information to New Models
Fixes: mozilla/addons#15476
Description
Changes promoted group information to be written directly to the new models rather than synced from PromotedAddon and PromotedApproval. This mainly includes:
- Changing
PrimaryHero'spromoted_addonOneToOneFieldto twoForeignKeys,addonandpromoted_group. i.promoted_groupallowsnull=Trueto represent theNOT_PROMOTEDstate. Its approval (i.e existingPromotedAddonPromotionof thataddonandpromoted_group) is implicitly checked via theapproved_applications_for()call. - Retired the
PromotedAddonAdminintoPromotedAddonPromotionAdminandPrimaryHeroAdmin-- splinteringPrimaryHeroInlineoff due to loss of direct FK. - Refactoring to be creating
PromotedAddonPromotions &PromotedAddonVersions.
Testing
PromotedAddonPromotion
- Create or delete a
PromotedAddonPromotionfor a group and application via the admin panel. - Approve that group for the add-on (i.e create a
PromotedAddonVersion). - Behaviour associated with a promotion should work as expected (ex. the banner on Reviewer Tools, the badge on the landing page if recommended or line).
Ex. Deleting PromotedAddonPromotions:
And recreating one:
PrimaryHero
- Create or modify a
PrimaryHerothrough the primary hero admin page. -
PrimaryHeroshould be created or updated as expected, just as it behaved as an Inline.
Checklist
- [x] Add
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository. - [x] Successfully verified the change locally.
- [x] The change is covered by automated tests, or otherwise indicated why doing so is unnecessary/impossible.
- [x] Add before and after screenshots (Only for changes that impact the UI).