from django.contrib.auth.mixins import LoginRequiredMixin from django.utils.translation import gettext_lazy as _ from django.views.generic import CreateView, FormView from participation.forms import TeamForm, JoinTeamForm from participation.models import Team class CreateTeamView(LoginRequiredMixin, CreateView): model = Team form_class = TeamForm extra_context = dict(title=_("Create team")) template_name = "participation/create_team.html" class JoinTeamView(LoginRequiredMixin, FormView): model = Team form_class = JoinTeamForm extra_context = dict(title=_("Join team")) template_name = "participation/create_team.html"