mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-02-16 02:10:45 +01:00
Removed duplicate format_time_spent function definition
This commit is contained in:
parent
cec1035c2d
commit
ae89d182a9
@ -173,11 +173,10 @@ def format_time_spent(time_spent):
|
|||||||
"""Format time_spent attribute to "[H]HHh:MMm" text string to be allign in
|
"""Format time_spent attribute to "[H]HHh:MMm" text string to be allign in
|
||||||
all graphical outputs
|
all graphical outputs
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if time_spent:
|
if time_spent:
|
||||||
time_spent = "{0:02d}h:{1:02d}m".format(
|
time_spent = "{0:02d}h:{1:02d}m".format(
|
||||||
time_spent.seconds // 3600,
|
int(time_spent.total_seconds()) // 3600,
|
||||||
time_spent.seconds // 60
|
int(time_spent.total_seconds()) % 3600 // 60
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
time_spent = ""
|
time_spent = ""
|
||||||
|
@ -8,7 +8,7 @@ models.py - Model (and hence database) definitions. This is the core of the
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from .lib import convert_value, daily_time_spent_calculation
|
from .lib import format_time_spent, convert_value, daily_time_spent_calculation
|
||||||
from .templated_email import send_templated_mail
|
from .templated_email import send_templated_mail
|
||||||
from .validators import validate_file_extension
|
from .validators import validate_file_extension
|
||||||
from .webhooks import send_new_ticket_webhook
|
from .webhooks import send_new_ticket_webhook
|
||||||
@ -33,17 +33,6 @@ from rest_framework import serializers
|
|||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
|
|
||||||
def format_time_spent(time_spent):
|
|
||||||
if time_spent:
|
|
||||||
time_spent = "{0:02d}h:{1:02d}m".format(
|
|
||||||
int(time_spent.total_seconds()) // 3600,
|
|
||||||
int(time_spent.total_seconds()) % 3600 // 60
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
time_spent = ""
|
|
||||||
return time_spent
|
|
||||||
|
|
||||||
|
|
||||||
class EscapeHtml(Extension):
|
class EscapeHtml(Extension):
|
||||||
def extendMarkdown(self, md):
|
def extendMarkdown(self, md):
|
||||||
md.preprocessors.deregister('html_block')
|
md.preprocessors.deregister('html_block')
|
||||||
|
Loading…
Reference in New Issue
Block a user