Compare commits

...

3 Commits

Author SHA1 Message Date
Lukáš Kucharczyk 72e89dae77
remove cruft
Django CI/CD / test (push) Successful in 1m7s Details
Django CI/CD / build-and-push (push) Successful in 2m0s Details
2024-08-08 09:47:06 +02:00
Lukáš Kucharczyk 1cd0a8c0fb
add shell.nix 2024-08-08 09:27:51 +02:00
Lukáš Kucharczyk a9a430f856
change vscode settings 2024-08-08 09:27:36 +02:00
4 changed files with 26 additions and 8 deletions

8
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,8 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.debugpy",
]
}

View File

@ -4,8 +4,9 @@
], ],
"python.testing.unittestEnabled": false, "python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true, "python.testing.pytestEnabled": true,
"python.analysis.typeCheckingMode": "basic", "python.analysis.typeCheckingMode": "strict",
"[python]": { "[python]": {
"editor.defaultFormatter": "ms-python.black-formatter" "editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true
}, },
} }

View File

@ -12,9 +12,8 @@ from django.db.models import (
Q, Q,
Sum, Sum,
fields, fields,
IntegerField,
) )
from django.db.models.functions import TruncDate, ExtractMonth, TruncMonth from django.db.models.functions import TruncDate, TruncMonth
from django.http import ( from django.http import (
HttpRequest, HttpRequest,
HttpResponse, HttpResponse,
@ -492,9 +491,7 @@ def stats_alltime(request):
Purchase.objects.all().intersection(purchases_finished_this_year).count() Purchase.objects.all().intersection(purchases_finished_this_year).count()
) )
first_play_name = "N/A"
first_play_date = "N/A" first_play_date = "N/A"
last_play_name = "N/A"
last_play_date = "N/A" last_play_date = "N/A"
if this_year_sessions: if this_year_sessions:
first_session = this_year_sessions.earliest() first_session = this_year_sessions.earliest()
@ -719,9 +716,7 @@ def stats(request, year: int = 0):
.count() .count()
) )
first_play_name = "N/A"
first_play_date = "N/A" first_play_date = "N/A"
last_play_name = "N/A"
last_play_date = "N/A" last_play_date = "N/A"
if this_year_sessions: if this_year_sessions:
first_session = this_year_sessions.earliest() first_session = this_year_sessions.earliest()

14
shell.nix Normal file
View File

@ -0,0 +1,14 @@
{
pkgs ? import <nixpkgs> { },
}:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
(poetry.override { python3 = python312; })
];
shellHook = ''
poetry install
'';
}