move time-related functionality out of views.general
All checks were successful
Django CI/CD / test (push) Successful in 58s
Django CI/CD / build-and-push (push) Successful in 1m52s

This commit is contained in:
2024-09-04 21:55:22 +02:00
parent 645ffa0dad
commit 98c9c1faee
8 changed files with 52 additions and 42 deletions

View File

@ -7,10 +7,10 @@ from django.shortcuts import get_object_or_404, redirect, render
from django.template.loader import render_to_string
from django.urls import reverse
from common.time import dateformat, local_strftime
from common.utils import A, Button
from games.forms import DeviceForm
from games.models import Device
from games.views.general import dateformat
@login_required
@ -47,7 +47,7 @@ def list_devices(request: HttpRequest) -> HttpResponse:
[
device.name,
device.get_type_display(),
device.created_at.strftime(dateformat),
local_strftime(device.created_at, dateformat),
render_to_string(
"cotton/button_group_sm.html",
{