Bug: app crashes when placeholder has no custom_id #20

Open
opened 2024-10-29 16:44:32 +00:00 by rskthomas · 2 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> . . . ```
Author
Owner

Closing this as ereuse/devicehub-django#25 fixed it.

Closing this as ereuse/devicehub-django#25 fixed it.
Owner

dado que tenemos que hacer merge otra vez de PR 25 pero adaptado a más commits, reabro

dado que tenemos que hacer merge otra vez de PR 25 pero adaptado a más commits, reabro
pedro reopened this issue 2024-11-10 02:32:42 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 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.