Skip to content

exam chronological ordering#65

Merged
yutotakano merged 2 commits intocompsoc-edinburgh:masterfrom
mostafam99:feature/exam-ordering
Dec 12, 2025
Merged

exam chronological ordering#65
yutotakano merged 2 commits intocompsoc-edinburgh:masterfrom
mostafam99:feature/exam-ordering

Conversation

@mostafam99
Copy link
Contributor

modified sort_key function to adjust slightly for exam months. the values are small so they don't conflict with year ordering. i don't know if this is a good fix or not

Copy link
Member

@yutotakano yutotakano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I like the 0.1/0.2/0.3/0.4 idea, but I'm not sure I like adding hardcoded values to these sort keys. I found an interesting function in the Python standard library that maybe we can use, could you look into that?

Copy link
Member

@yutotakano yutotakano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for working through this! Been bugging many people I think, your help is much appreciated.

@yutotakano yutotakano merged commit 14597f8 into compsoc-edinburgh:master Dec 12, 2025
5 checks passed
@mostafam99 mostafam99 deleted the feature/exam-ordering branch December 13, 2025 11:37
yutotakano added a commit that referenced this pull request Jan 23, 2026
Hotfix bug in exam sorting introduced by #65
@yutotakano
Copy link
Member

There was a regression introduced by this PR where visiting the FNLP page would crash the backend:

2026-01-23T19:38:51.100 INFO [gunicorn] [ERROR] Internal Server Error: /api/category/listexams/fnlp/
2026-01-23T19:38:51.101 INFO [gunicorn] Traceback (most recent call last):
2026-01-23T19:38:51.101 INFO [gunicorn]   File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/exception.py", line 56, in inner
2026-01-23T19:38:51.101 INFO [gunicorn]     response = get_response(request)
2026-01-23T19:38:51.101 INFO [gunicorn]   File "/usr/local/lib/python3.9/dist-packages/django/core/handlers/base.py", line 197, in _get_response
2026-01-23T19:38:51.101 INFO [gunicorn]     response = wrapped_callback(request, *callback_args, **callback_kwargs)
2026-01-23T19:38:51.101 INFO [gunicorn]   File "/app/util/response.py", line 34, in wrapper
2026-01-23T19:38:51.101 INFO [gunicorn]     return f(request, *args, **kwargs)
2026-01-23T19:38:51.101 INFO [gunicorn]   File "/app/ediauth/auth_check.py", line 86, in wrapper
2026-01-23T19:38:51.101 INFO [gunicorn]     return f(request, *args, **kwargs)
2026-01-23T19:38:51.101 INFO [gunicorn]   File "/app/categories/views.py", line 119, in list_exams
2026-01-23T19:38:51.101 INFO [gunicorn]     res = sorted(
2026-01-23T19:38:51.102 INFO [gunicorn] TypeError: '<' not supported between instances of 'tuple' and 'datetime.datetime'

Fixed in #74.

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