pretalx / pretalx

Conference planning tool: CfP, scheduling, speaker management
https://pretalx.com
Apache License 2.0
705 stars 199 forks source link

Remove pretalx.common.models.Choices #1758

Open rixx opened 4 months ago

rixx commented 4 months ago

Our helper class for enums/choices is used in only two places, and is from a time before Django had TextChoices, which we should use instead.

mridubhatnagar commented 3 months ago

@rixx can I take this up?

rixx commented 3 months ago

@mridubhatnagar sure!

mridubhatnagar commented 3 months ago

@rixx I have completed the task. Should I delete the file choices.py as it is no more being used. Or we will be keeping it as is?

mridubhatnagar commented 2 months ago

@rixx thanks for your inputs. Based on your inputs have updated the changes that I had done in questions.py. However, for submissions.py. Inheriting the class from TextChoices instead of Choices is leading to changes at other places in the codebase. Hence, I am still figuring it out.

As, the class is inheriting from TextChoices. I am not able to access the dictionaries present in SubmissionStates class from outside.

rixx commented 2 months ago

@mridubhatnagar I'm afriad I do not currently have the time to advise you in detail on how to implement this PR (if I had to do that, I might as well implement it myself in the same time). I think the choices going forward are that either this PR finishes the removal of pretalx.common.models.Choices, or we'll close it for now.

mridubhatnagar commented 2 months ago

@rixx you can close the MR.