Skip to content

#1259 - fix ticket_list sorting #1260

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

finnertysea
Copy link
Contributor

changes to sorting.html:

  • make id and name of select element match name of param in ticket_list() view.

changes to get_datatables_context():

  • adjust defaults to get information from existing query set if available while still changing with any new sorting done by datatables.
  • remove first .orderby() since it is made useless by second use of .orderby() right before return.

@finnertysea finnertysea marked this pull request as ready for review April 19, 2025 04:19
@DavidVadnais
Copy link
Collaborator

DavidVadnais commented Apr 21, 2025

I just confirmed that sorting does not work in the latest commit 1f22f54. I am now going to test the fix.

@DavidVadnais
Copy link
Collaborator

DavidVadnais commented Apr 21, 2025

From what I can tell the issue persists. I likely need more context. I believed the goal was to fix the reverse button. I would guess that it would yield a different ticket order but it did not for me.
tickets-no_reverse-2025-04-21
tickets-reverse-2025-04-21

I cloned your repo and built a docker image with

'''
docker build --progress=plain -t djangohelpdesk/standalone:latest -f standalone/Dockerfile .
cd standalone
docker compose up
'''

I was worried somehow I had an old image so I ran docker exec -it standalone-django-helpdesk-1 bash and verified the python files contained your changes.

Am I testing the wrong thing?

@finnertysea
Copy link
Contributor Author

It's working for me. To verify, I did a clean install from the latest revision in my helpdesk repo. I have some custom styles in my dev env which is why the filters are tabbed, but that shouldn't be impacting their functionality at all.

When /tickets/ is first loaded:
Screenshot 2025-04-24 at 10 11 40

When sorting="title" and the form is submitted:
Screenshot 2025-04-24 at 10 12 26

And when sorting="title" and reverse is checked, then the form submitted:
Screenshot 2025-04-24 at 10 12 39

@DavidVadnais
Copy link
Collaborator

I still cant replicate the success. Can you tell me what database you're using and the python/django versions?

The standalone uses postgresql 17 and

python --version
Python 3.11.12

pip list 
...
Django                 5.2
django-appconf         1.1.0
django-bootstrap4-form 4.0.2
django-cleanup         9.0.0
django-helpdesk        1.4.0       /opt/django-helpdesk
django-model-utils     5.0.0
django-reversion       5.1.0
django-user-accounts   3.3.2
djangorestframework    3.16.0
...

Also I'm going to bring in the big guns as they might have a better idea of whats happening.
@uhurusurfa, @timthelion, @Benbb96

@DavidVadnais DavidVadnais requested a review from uhurusurfa April 24, 2025 21:50
@uhurusurfa
Copy link
Collaborator

uhurusurfa commented Apr 26, 2025 via email

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.

3 participants