mediacloud / web-search

Code that drives the public web-based tools for the Media Cloud Online News Archive and Directory.
https://search.mediacloud.org
Apache License 2.0
8 stars 12 forks source link

need to prevent creation of duplicate sources #658

Open rahulbot opened 3 weeks ago

rahulbot commented 3 weeks ago

I was able to create a duplicate source without any errors. Our system relies on the idea that source name (the root URL) is mostly unique. Steps to reproduce:

  1. note that "jweekly.com" already exists at https://search.mediacloud.org/sources/29047
  2. create a new source with name set to "jweekly.com" and some notes and a label
  3. click save

Since neither 29047 or the new one has url_search_string this should have thrown an error preventing me from creating a duplicate source. Instead, I was able to create it. If one of them had a url_search_string set it should have let me create the source to allow for our small list of exception cases.