On corrige un bug en cas de création sans run
This commit is contained in:
parent
e04d94f97a
commit
2bc1f36139
@ -1364,7 +1364,10 @@ class RecurrentImport(models.Model):
|
|||||||
events = BatchImportation.objects.filter(recurrentImport=self).order_by(
|
events = BatchImportation.objects.filter(recurrentImport=self).order_by(
|
||||||
"-created_date"
|
"-created_date"
|
||||||
)
|
)
|
||||||
|
if events and len(events) > 0:
|
||||||
return events[0]
|
return events[0]
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
class BatchImportation(models.Model):
|
class BatchImportation(models.Model):
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
{% if obj.last_import.status != "running" %}
|
{% if not obj.last_import or obj.last_import.status != "running" %}
|
||||||
<a href="{% url 'run_rimport' obj.pk %}" role="button">Exécuter</a>
|
<a href="{% url 'run_rimport' obj.pk %}" role="button">Exécuter</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{% url 'cancel_import' obj.last_import.pk %}" role="button">Annuler</a>
|
<a href="{% url 'cancel_import' obj.last_import.pk %}" role="button">Annuler</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user