sio2project / oioioi

GNU General Public License v3.0
160 stars 70 forks source link

DifficultyTag's aren't sorted #344

Open metenn opened 3 months ago

metenn commented 3 months ago

Seems like somebody forgot ordering = ['pk'] in Meta https://github.com/sio2project/oioioi/blob/5414a6ce7dbe790905114895e8b2415674a70f43/oioioi/problems/models.py#L818-L838 same goes for DifficultyTagLocalization, which is why this code returns unsorted rows (per SQL specs rows are not automatically sorted by any field) https://github.com/sio2project/oioioi/blob/5414a6ce7dbe790905114895e8b2415674a70f43/oioioi/problems/views.py#L556 so another fix would probably be adding an .order_by() here?

perhaps the ordering should be more explicit in the first place rather than relying on the autogenerated pk field?

metenn commented 3 months ago

As a bonus: Seems like the styling on these buttons is a bit broken, not to mention the inconsistent heights.

https://github.com/sio2project/oioioi/assets/49620905/cb16c10b-9ef7-456b-b1db-32482b6472ac