Parsing error handling and MAC retrieval on new snapshots #27
|
@ -15,7 +15,7 @@ from utils.save_snapshots import move_json, save_in_disk
|
|||
class UploadForm(forms.Form):
|
||||
evidence_file = MultipleFileField(label=_("File"))
|
||||
|
||||
def clean(self):
|
||||
def clean_evidence_file(self):
|
||||
self.evidences = []
|
||||
data = self.cleaned_data.get('evidence_file')
|
||||
if not data:
|
||||
|
|
|
@ -8,21 +8,19 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- override invalid-feedback class -->
|
||||
<style>
|
||||
.invalid-feedback {
|
||||
color: #670000;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% load django_bootstrap5 %}
|
||||
<form role="form" method="post" enctype="multipart/form-data">
|
||||
{% csrf_token %}
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger alert-icon alert-icon-border alert-dismissible" role="alert">
|
||||
<div class="icon"><span class="mdi mdi-close-circle-o"></span></div>
|
||||
<div class="message">
|
||||
{% for error in form.non_field_errors %}
|
||||
{{ error }}<br />
|
||||
{% endfor %}
|
||||
<button class="btn-close" type="button" data-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% bootstrap_form form alert_error_type="fields" %}
|
||||
|
||||
{% bootstrap_form form alert_error_type="none" error_css_class="alert alert-danger alert-icon alert-icon-border" %}
|
||||
<div class="form-actions-no-box">
|
||||
<a class="btn btn-grey" href="{% url 'dashboard:unassigned_devices' %}">{% translate "Cancel" %}</a>
|
||||
<input class="btn btn-green-admin" type="submit" name="submit" value="{% translate 'Save' %}" />
|
||||
|
|
Loading…
Reference in New Issue