Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the "SessionAdmin" class' readonly_fields with has_add_permission and has_change_permission #21

Merged
merged 1 commit into from
Jun 22, 2024

Conversation

ataylor32
Copy link
Contributor

If you go to the "Add session" form (/admin/qsessions/session/add/), the following exception is thrown due to line 102 in admin.py:

TypeError: '>' not supported between instances of 'NoneType' and 'datetime.datetime'

But even if that bug wasn't present, there would be no point in going to the "Add session" form anyway since all of the fields are read-only.

Similarly, since all of the fields are read-only, the "Change session" form's "SAVE", "Save and add another", and "Save and continue editing" buttons are all kind of confusing since there's nothing to save.

This pull request disables adding and changing, which fixes the exception and makes the interface make more sense.

@mjnaderi
Copy link
Member

Hi @ataylor32
Thanks for your contribution. Ignore the failed test. It's because of a misconfiguration. I'll fix it.

@mjnaderi mjnaderi merged commit ea77106 into QueraTeam:main Jun 22, 2024
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants