mirror of https://github.com/snachodog/mybuddy.git
Fixer Timer.stop method to respect custom end argument.
This commit is contained in:
parent
c38290838b
commit
99dcb1e7ca
|
@ -182,7 +182,7 @@ class Timer(models.Model):
|
||||||
def stop(self, end=None):
|
def stop(self, end=None):
|
||||||
"""Stop the timer."""
|
"""Stop the timer."""
|
||||||
if not self.end:
|
if not self.end:
|
||||||
self.end = timezone.now()
|
end = timezone.now()
|
||||||
self.end = end
|
self.end = end
|
||||||
self.save()
|
self.save()
|
||||||
|
|
||||||
|
|
|
@ -48,14 +48,16 @@
|
||||||
role="button"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
role="button"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if object.active and perms.core.change_timer %}
|
{% if perms.core.change_timer %}
|
||||||
<a class="btn btn-secondary"
|
<a class="btn btn-secondary"
|
||||||
href="{% url 'timer-restart' timer.id %}"
|
href="{% url 'timer-restart' timer.id %}"
|
||||||
role="button"><i class="fa fa-refresh" aria-hidden="true"></i></a>
|
role="button"><i class="fa fa-refresh" aria-hidden="true"></i></a>
|
||||||
|
|
||||||
<a class="btn btn-warning"
|
{% if object.active %}
|
||||||
href="{% url 'timer-stop' timer.id %}"
|
<a class="btn btn-warning"
|
||||||
role="button"><i class="fa fa-stop" aria-hidden="true"></i></a>
|
href="{% url 'timer-stop' timer.id %}"
|
||||||
|
role="button"><i class="fa fa-stop" aria-hidden="true"></i></a>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue