Parisson / Telemeta

Collaborative content management system for musicology
http://telemeta.org
GNU Affero General Public License v3.0
118 stars 38 forks source link

Error when creating an entity having a "Code" field containing spaces #187

Closed amotl closed 7 years ago

amotl commented 7 years ago

Dear Guillaume, Thomas, Mathieu and the whole Telemeta team,

first things first: Thank you for conceiving this great piece of software!

When getting into Telemeta, we found a minor issue when creating a Fond or a Corpus and assigning a "Code" field containing a space character. While Telemeta accepts the creation of this entity, it will error out even when displaying the Index page (e.g. /archives/fonds, /archives/corpus) after doing so. A workaround for us was to delete the offending entity using the Django admin. The problem will probably also appear for Collections and Items.

If we get around setting up a development instance on our workstations, we might even contribute a bugfix, but in the meanwhile we just wanted to ping you about this problem.

With kind regards, Andreas.


P.S.: Some background about us: We want to operate a collaborative community platform for collecting audio recordings from beehives around the world and found Telemeta to be very suitable. The Telemeta instance of the Hiveeyes project is currently hosted at https://telemeta.hiveeyes.org/.

josimonnot commented 7 years ago

Dear Andreas Moti,

Welcome in the Telemeta Community! The space character is not allowed in the code and i think it is a decision, not a bug. You have to create a collection first, then a Corpus with a collection you choose in the list of collections. Affer you have a Corpus with 1 or more collection, you can create a Fonds with 1 corpus or more.

Have a nice day

Joséphine Simonnot Responsable techniques de l'information et de la communication CREM/LESC, CNRS Nanterre France

Le 26 juil. 2017 à 02:01, Andreas Motl notifications@github.com<mailto:notifications@github.com> a écrit :

Dear Guillaume, Thomas and the whole Parisson team,

first things first: Thank you for conceiving this great piece of software!

When getting into Telemeta, we found a minor issue when creating a Fond or a Corpus and assigning a "Code" field containing a space character. While Telemeta accepts the creation of this entity, it will error out even when displaying the Index page (e.g. /archives/fonds, /archives/corpus) after doing so. A workaround for us was to delete the offending entity using the Django admin. The problem will probably also appear for Collections and Items.

If we get around setting up a development instance on our workstations, we might even contribute a bugfix, but in the meanwhile we just wanted to ping you about this problem.

With kind regards, Andreas.


P.S.: Some background about us: We want to operate a collaborative community platform for collecting audio recordings from beehives around the world and found Telemeta to be very suitable. The Telemeta instance of the Hiveeyes projecthttps://hiveeyes.org/ is currently hosted at https://telemeta.hiveeyes.org/.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/Parisson/Telemeta/issues/187, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AIkVDEx2vAthEWSlNgZng958qK2vu6L3ks5sRoHbgaJpZM4OjRQF.

amotl commented 7 years ago

Dear Joséphine,

thanks for getting back!

The space character is not allowed in the code and i think it is a decision, not a bug.

I guessed so. We just wanted to mention this should probably be catched before the form submission using an appropriate validator, so Telemeta will not error out when accessing the offending entity again. At the moment, it is possible to create entities containing spaces in the "Code" field, the data entry form currently doesn't prevent it.

With kind regards, Andreas.

yomguy commented 7 years ago

Dear @amotl

Thanks for the review and kind words ;) I've just pushed a validator for Resource.code (on which Corpus and Fonds are based) which can be override in the settings. But as you noticed, any space in a good code or id is indeed bad ;) Please test it.

Cheers, Guillaume

amotl commented 7 years ago

Dear Guillaume,

thanks for adding an appropriate validator, it works like a charm. We tested using the "dev" branch and had to rebuild the container images. Thanks a bunch!

With kind regards, Andreas.

P.S.: For all others to save them from figuring out the required steps:

cd /opt/Telemeta
git pull
git checkout dev
export TEMP=/var/tmp
docker-compose up --build