usgo / agagd

American Go Association Games Database (AGAGD)
https://agagd.usgo.org
MIT License
47 stars 30 forks source link

make_fake_fixtures.py creates chapters whose member IDs overlap real members #133

Open annabunches opened 4 years ago

annabunches commented 4 years ago

Summary of the Bug

In the prod AGAGD, the Chapters table has member_ids that correspond to a chapter-type member in the Members table. For example, https://agagd.usgo.org/chapter/NOVA/ corresponds to https://agagd.usgo.org/player/126/. In other words, the primary key field member_id is unique across both the Members and the Chapters table/model.

make_fake_fixtures.py, however, creates chapters with IDs that correspond to normal players.

Steps to Reproduce the Behaviour

i.e.,

  1. docker-compose down -v (this will delete any test data you currently have)
  2. docker-compose build
  3. docker-compose up

The Expected Behaviour

Chapters should ideally have corresponding Member objects with the same member_id.

Notes

This only affects local dev work, and only in very rare circumstances, so this should be a low priority issue.

abaisero commented 2 years ago

I'm looking into this as a low-fruit contribution. It seems like a Chapter should also have a corresponding Member entry, but the fixture script does not currently make one. I think to fix this a corresponding Member entry should be created, but Member has many fields which I wouldn't know how to fill, e.g., given_names, family_name, occupation, citizen, etc.

image

If anybody is willing to give any guidance on how to fill those entries for a Chapter, I'd be happy to fix the fixtures, and make other improvements to the script.