[GrandComicsDatabase/gcd-django] check currency codes (#497)

8 views
Skip to first unread message

jochengcd

unread,
Aug 12, 2021, 8:50:18 AM8/12/21
to GrandComicsDatabase/gcd-django, Subscribed

Using a list of currency codes we could check if the used ones are existing. Avoids common errors.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Adam Hernandez

unread,
May 5, 2026, 1:03:28 AMMay 5
to GrandComicsDatabase/gcd-django, Subscribed
DeusExTaco left a comment (GrandComicsDatabase/gcd-django#497)

I took a closer look at this one, and there is definitely a real gap here.

Right now we already have a Currency model plus a local fixture of currency
codes, and the issue edit help text tells editors to use ISO-style price
strings like 0.50 USD. But the actual issue price field is still just a
free-form string, and I couldn’t find any validation in the issue form code
that checks the currency token against the currency table.

That said, this is a little trickier than “just validate against ISO 4217”.
The existing price syntax is legacy and allows a few special cases:

  • multiple prices separated by semicolons
  • notes in parentheses
  • country suffixes like EUR DE
  • pre-decimal notation like 2/6 [0-2-6 GBP]
  • 0.00 FREE, which is documented but does not fit the current 3-character
    currency code model

So I think the right fix is:

  1. add form-level parsing/validation for issue prices
  2. extract and validate currency tokens from each price segment
  3. explicitly decide what to allow for FREE, pre-decimal syntax, and
    historical currencies
  4. add tests for valid and invalid examples
  5. probably also add an audit script for existing stored price strings before
    tightening enforcement too much

So overall: good issue, but it needs a small design pass first so we don’t
accidentally reject legitimate historical/legacy price data.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/issues/497/4376658852@github.com>

Reply all
Reply to author
Forward
0 new messages