Skip to content

IVS-866 - Ability to navigate to end-user reports - #315

Merged
rw-bsi merged 4 commits into
developmentfrom
IVS-866_Ability_to_navigate_to_Reports
Aug 4, 2026
Merged

IVS-866 - Ability to navigate to end-user reports#315
rw-bsi merged 4 commits into
developmentfrom
IVS-866_Ability_to_navigate_to_Reports

Conversation

@rw-bsi

@rw-bsi rw-bsi commented Aug 3, 2026

Copy link
Copy Markdown
Contributor
  • support both request_id (as-is) and model_id
  • allow is_staff users to render all reports

@rw-bsi
rw-bsi requested a review from Ghesselink August 3, 2026 22:06
@rw-bsi rw-bsi self-assigned this Aug 3, 2026
@rw-bsi
rw-bsi requested a review from civilx64 August 3, 2026 22:12
@rw-bsi rw-bsi changed the title IVS-866 - Ability to navigate to user report IVS-866 - Ability to navigate to end-user reports Aug 3, 2026

@Ghesselink Ghesselink left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice :-)

Comment on lines +434 to +446
if id.startswith("r"):
priv_id = ValidationRequest.to_private_id(id)

elif id.startswith("m"):
model_id = Model.to_private_id(id)
priv_id = (
ValidationRequest.objects.filter(model_id=model_id)
.values_list("id", flat=True)
.first()
)

if not priv_id:
return HttpResponseNotFound()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The code only creates priv_id when the id starts with r or m, so any other id (like t42 or whatever) reaches 'if not priv_id). This doesn't exist or can't convert to an integer and crashes with a 500 error. Adding else: return HttpResponseNotFound() and try/except makes those ids get 404 instead.

Suggested change
if id.startswith("r"):
priv_id = ValidationRequest.to_private_id(id)
elif id.startswith("m"):
model_id = Model.to_private_id(id)
priv_id = (
ValidationRequest.objects.filter(model_id=model_id)
.values_list("id", flat=True)
.first()
)
if not priv_id:
return HttpResponseNotFound()
try:
if id.startswith("r"):
priv_id = ValidationRequest.to_private_id(id)
elif id.startswith("m"):
model_id = Model.to_private_id(id)
priv_id = (
ValidationRequest.objects.filter(model_id=model_id)
.values_list("id", flat=True)
.first()
)
else:
return HttpResponseNotFound()
except ValueError:
return HttpResponseNotFound()
if not priv_id:
return HttpResponseNotFound()

@rw-bsi
rw-bsi requested a review from Ghesselink August 4, 2026 18:41
@rw-bsi
rw-bsi merged commit 152f186 into development Aug 4, 2026
3 checks passed
@rw-bsi
rw-bsi deleted the IVS-866_Ability_to_navigate_to_Reports branch August 4, 2026 18:48
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