Skip to content

Fixed owner filtering, DicomTask reset/delete views, and DICOM Explor…#236

Merged
medihack merged 2 commits intoopenradx:mainfrom
mhumzaarain:Bugs-fix
Sep 23, 2025
Merged

Fixed owner filtering, DicomTask reset/delete views, and DICOM Explor…#236
medihack merged 2 commits intoopenradx:mainfrom
mhumzaarain:Bugs-fix

Conversation

@mhumzaarain
Copy link
Collaborator

Fix DicomTask owner filtering, reset/delete views, and DICOM Explorer URL & query bugs

Description

This PR addresses multiple related issues in the task and DICOM Explorer modules:

1. Fix DicomTask owner filtering

  • The DicomTask model does not have a direct owner field; the owner exists on task.job.
  • Previous code used filter(owner=self.request.user), causing FieldError.
  • Fixed by filtering through the relationship: filter(job__owner=self.request.user).

2. Fix DicomTaskResetView and DicomTaskDeleteView

  • ResetView: The task status was updated to PENDING but queued without refreshing from the DB, causing a status mismatch.
    • Now the task is refreshed after status update before calling queue_pending_task().
  • DeleteView: Queryset filtered incorrectly by non-existent owner field.
    • Updated to filter by job__owner to respect is_deletable checks.
  • These fixes resolve failing tests: test_task_reset_view and test_task_delete_view.

3. Fix DICOM Explorer server query bug: remove non-existent 'accesses_source' filter when querying DicomServer.

  • Patient query URL:
    # Previous
    url = reverse("dicom_explorer_patient_query")
    
    # Updated
    url = reverse("dicom_explorer_patient_query", kwargs={"server_id": server.id})

@medihack medihack merged commit ed756b0 into openradx:main Sep 23, 2025
1 check passed
samuelvkwong pushed a commit to samuelvkwong/adit that referenced this pull request Oct 9, 2025
…er bugs (openradx#236)

Co-authored-by: mhumzaarain <smarai@uni-bonn.de>
Co-authored-by: Kai Schlamp <kai.schlamp@gmail.com>
samuelvkwong added a commit that referenced this pull request Oct 15, 2025
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