This repository has been archived on 2025-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Employee-Management-Portal/work/views.py
Alicja Cięciwa 3ffce6c7c3 registration fixes
2020-11-15 13:32:50 +01:00

24 lines
643 B
Python

from django.http import HttpResponseRedirect
from django.shortcuts import render
from work.forms import HoursInputForm
from django.contrib.auth.decorators import login_required
#
# @login_required
# def index(request):
# return render(request,'registration/login.html')
@login_required
def get_basic_workdata(request):
title = "Godziny"
if request.method == 'POST':
form = HoursInputForm(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/')
else:
form = HoursInputForm()
return render(request, 'inputhours.html', {'form': form, 'title': title})