denshoproject / encyc-front

front-end interface for the encyclopedia
Other
1 stars 0 forks source link

public UI no respecting PSMS copyright settings #122

Closed gjost closed 2 months ago

gjost commented 8 months ago

Dana: We received an email from the GLBT Historical Society about one of our encyclopedia article’s primary sources: https://encyclopedia.densho.org/Jiro_Onuma/. All of the photos are displayed as available under our Creative Commons license, but the cc box on each record in the primary source database is not checked, and they should be copyright restricted, not Creative Commons, per the wishes of the donor org. I did a quick spot check, and I think this may be true of other primary sources as well.

gjost commented 8 months ago

Article: https://encyclopedia.densho.org/Jiro_Onuma/ PSMS: https://psms.densho.org/admin/sources/source/2237/change/ Primary Source: https://encyclopedia.densho.org/sources/en-onuma-block3mess-1/

gjost commented 8 months ago

I can verify that the "Creative Commons" checkbox is un-set in encyc-psms but the license appears on the source page in encyc-front. The source API lists creative_commons as true. I went into the source code for encyc-core (the code that publishes Encyclopedia data from the PSMS and wiki to the public site) and had it print out the value of creative_commons during the publish process, and found that the value is "False" i.e. it is a string and not a boolean value. In Elasticsearch the field is Boolean. This means that a non-blank string is interpreted as true.

Digging into the source some more, the encyc-core gets its data from the encyc-psms API as strings, and neglects to convert data to Python types.

This has been a bug for a long time.

I'll whip up a function in encyc-core to convert Boolean values and publish this as a hotfix.

gjost commented 8 months ago

Fixed in encyc-core commit 20ca99d and merged in to master.

gjost commented 8 months ago

Ran encyc sources --force to update all primary sources. Values of creative_commons should now be updated for all records.