Bug: app crashes when placeholder has no custom_id #20

Open
opened 2024-10-29 16:44:32 +00:00 by rskthomas · 0 comments
Owner

Buenas,

Ocurre que cuando se crea un placeholder sin custom id, luego en la vista de detalle la aplicación se rompe.

Info:

Request Method: 	GET
Request URL: 	http://localhost:8000/device/cbe0ffa654154e231daba63549e3cf8650b84302a62218e2ce1fc0a7b849dd8f/
Django Version: 	5.0.6
Exception Type: 	KeyError
Exception Value: 	 'kv'
Exception Location: 	/opt/devicehub-django/device/models.py, line 274, in last_user_evidence
Raised during: 	device.views.DetailsView
Python Executable: 	/usr/local/bin/python
Python Version: 	3.11.10

Error during template rendering: 
In template /opt/devicehub-django/device/templates/details.html, error at line 60

. . .
59 	    {% if object.is_websnapshot %}
60 	    {% for k, v in object.last_user_evidence %}
61 	    <div class="row">
62 	      <div class="col-lg-3 col-md-4 label">{{ k }}</div>
63 	      <div class="col-lg-9 col-md-8">{{ v|default:"" }}</div>
64 	    </div>
. . . 

Buenas, Ocurre que cuando se crea un placeholder sin custom id, luego en la vista de detalle la aplicación se rompe. Info: ``` Request Method: GET Request URL: http://localhost:8000/device/cbe0ffa654154e231daba63549e3cf8650b84302a62218e2ce1fc0a7b849dd8f/ Django Version: 5.0.6 Exception Type: KeyError Exception Value: 'kv' Exception Location: /opt/devicehub-django/device/models.py, line 274, in last_user_evidence Raised during: device.views.DetailsView Python Executable: /usr/local/bin/python Python Version: 3.11.10 Error during template rendering: In template /opt/devicehub-django/device/templates/details.html, error at line 60 . . . 59 {% if object.is_websnapshot %} 60 {% for k, v in object.last_user_evidence %} 61 <div class="row"> 62 <div class="col-lg-3 col-md-4 label">{{ k }}</div> 63 <div class="col-lg-9 col-md-8">{{ v|default:"" }}</div> 64 </div> . . . ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ereuse/devicehub-django#20
No description provided.