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):
|
||||
"""Stop the timer."""
|
||||
if not self.end:
|
||||
self.end = timezone.now()
|
||||
end = timezone.now()
|
||||
self.end = end
|
||||
self.save()
|
||||
|
||||
|
|
|
@ -48,14 +48,16 @@
|
|||
role="button"><i class="fa fa-trash" aria-hidden="true"></i></a>
|
||||
{% endif %}
|
||||
|
||||
{% if object.active and perms.core.change_timer %}
|
||||
{% if perms.core.change_timer %}
|
||||
<a class="btn btn-secondary"
|
||||
href="{% url 'timer-restart' timer.id %}"
|
||||
role="button"><i class="fa fa-refresh" aria-hidden="true"></i></a>
|
||||
|
||||
<a class="btn btn-warning"
|
||||
href="{% url 'timer-stop' timer.id %}"
|
||||
role="button"><i class="fa fa-stop" aria-hidden="true"></i></a>
|
||||
{% if object.active %}
|
||||
<a class="btn btn-warning"
|
||||
href="{% url 'timer-stop' timer.id %}"
|
||||
role="button"><i class="fa fa-stop" aria-hidden="true"></i></a>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue