Skip to content

Commit

Permalink
Delete unused registration view
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Oct 5, 2023
1 parent c6d840b commit c0e3ab9
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions adit/accounts/views.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
from typing import Any

from django.contrib.auth.mixins import AccessMixin, LoginRequiredMixin
from django.http import HttpResponse
from django.views.generic import TemplateView
from django.views.generic.edit import CreateView

from adit.core.types import AuthenticatedHttpRequest

from .forms import RegistrationForm
from .models import User


class UserProfileView(LoginRequiredMixin, AccessMixin, TemplateView):
template_name = "accounts/profile.html"
Expand All @@ -19,13 +14,3 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context = super().get_context_data(**kwargs)
context["user"] = self.request.user
return context


class RegistrationView(CreateView):
model = User
form_class = RegistrationForm
template_name = "accounts/registration.html"

def form_valid(self, form: RegistrationForm) -> HttpResponse:
form.instance.is_active = False
return super().form_valid(form)

0 comments on commit c0e3ab9

Please sign in to comment.