Add more data to model and login

This commit is contained in:
Nyymix 2025-08-09 22:53:35 +03:00
parent 783e5e92cb
commit 522322b1e1
8 changed files with 147 additions and 6 deletions

View file

@ -1,6 +1,8 @@
from calendar import monthrange
from datetime import date, timedelta
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.db.models import Avg, Max, Min, Sum
from django.http import HttpResponse
from django.shortcuts import render
@ -63,7 +65,7 @@ class FuelPurchaseMonthlyListView(ListView):
return context
class FuelPurchaseCreateView(CreateView):
class FuelPurchaseCreateView(LoginRequiredMixin, CreateView):
model = FuelPurchase
form_class = FuelPurchaseForm
template_name = "main/fuelpurchase_add.html"