Creator/Character remove name problem

4 views
Skip to first unread message

Adam Knights

unread,
Oct 24, 2021, 4:20:13 AM10/24/21
to gcd-...@googlegroups.com
Hi,

We are currently able to submit a change set with zero changes when we try to delete a non-official name of a creator or character, and that name is used somewhere. Validation should prevent saving/submitting the change set and tell the user that the name they are trying to delete is still used. It looks like the protection is working, just not the messaging and prevention of submitting.

Reproduction:
Find a creator or character who has a non-official name that is used in a sequence
Remove the name
Save
Notice a change set with 0 changes

When a name is not used, it works as expected.

Cheers
Adam

Jochen G.

unread,
Oct 24, 2021, 4:23:57 AM10/24/21
to gcd-...@googlegroups.com
For Creators there is a note under each name that cannot be deleted:
Creator names with existing credits cannot be removed.

For characters this is not done so far at all, on the ToDo list.

The checking in the form is not possible. There might be a way to not
show the 'remove' link at all, but that likely needs someone with
JavaScript-knowledge to check.

Jochen

Am 24.10.21 um 10:20 schrieb Adam Knights:
> --
> You received this message because you are subscribed to the Google
> Groups "gcd-tech" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gcd-tech+u...@googlegroups.com
> <mailto:gcd-tech+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gcd-tech/CAODfJQzR%3DTR1ZXw6yJK1FyUepnCV1_gs3cvDBFuE%2By-LuMAOiw%40mail.gmail.com
> <https://groups.google.com/d/msgid/gcd-tech/CAODfJQzR%3DTR1ZXw6yJK1FyUepnCV1_gs3cvDBFuE%2By-LuMAOiw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Adam Knights

unread,
Oct 24, 2021, 5:05:26 AM10/24/21
to gcd-tech
Thanks for the quick reply!

I think if we place an attribute on from the server side like say  forms.TextInput(attrs={'hasExistingCredits': '1'}), and 0 if none, but ideally at the row level...

Then the javascript would be a case of adding to https://github.com/GrandComicsDatabase/gcd-django/blob/0c39dd6b64973776a14ed825c49fc48e5a95ef11/static/js/jquery.formset.js#L55 in some way where in the insert delete function call, we disable the remove if it finds the row has the attribute with value 1 (or however we do it).

I'm keen on javascript, so ill make this my first thing to try. I'll see if I can get the code working on my machine soon.

Cheers,
Adam

Jochen G.

unread,
Oct 24, 2021, 5:59:25 AM10/24/21
to gcd-...@googlegroups.com
We do a check on the server side to get the help text, so we should be
able to add a hidden-value for each creator name that can be used for this.

Am 24.10.21 um 11:05 schrieb Adam Knights:
> <https://groups.google.com/d/msgid/gcd-tech/CAODfJQzR%3DTR1ZXw6yJK1FyUepnCV1_gs3cvDBFuE%2By-LuMAOiw%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/gcd-tech/CAODfJQzR%3DTR1ZXw6yJK1FyUepnCV1_gs3cvDBFuE%2By-LuMAOiw%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "gcd-tech" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gcd-tech+u...@googlegroups.com
> <mailto:gcd-tech+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gcd-tech/8d85c47a-bb64-4bdf-896f-bd4d1daa6944n%40googlegroups.com
> <https://groups.google.com/d/msgid/gcd-tech/8d85c47a-bb64-4bdf-896f-bd4d1daa6944n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Reply all
Reply to author
Forward
0 new messages