from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from match.models import RefMatch


# Create your views here.
@login_required
def index(request):
    listmatch = RefMatch.objects.all().exclude(match_fini=True)
    if len(listmatch) == 0:
        return redirect('add_match')
    else:
        return redirect('list_match')
    return render(request, "index.html")


