this commit does three things:
* runs a data migration to delete duplicate external feeds. duplicates
are defined as having the same context, url, verbosity, and header match
* prevents duplicates from being created on course copy, by searching
for and re-using an existing feed if it exists when importing
* validating uniqueness of newly created/saved external feeds, and
exposing validation errors in the UI
fixes CNVS-17523
test plan:
- before downloading this commit, create two courses, go to the
announcments pages, and create several different external feeds, some
of which only duplicate the url (but have differences for other values)
and some of which are exact duplicates
- checkout this patchset, run migrations
- those courses should now only have unique feeds (the full duplicates
will be deleted)
- now try creating a new full duplicate
- you should get an error message that says "taken" on the url field
- try importing the feeds from a course with a feed into another course
that has the exact same external feed
- it should succeed, but not create a duplicate feed in the second course
Change-Id: If1655283102a74626c4579c24382cde92115e776
Reviewed-on: https://gerrit.instructure.com/45991
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Reviewed-by: John Corrigan <jcorrigan@instructure.com>
QA-Review: Derek Hansen <dhansen@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>