if authenticated in class based view

How do I check if a user is already logged in, in a class-based view ?

class SignUp(generic.CreateView):
    # Check if user is already logged-in, then redirect to dashboard

class-based equivalent of this :

def signup(request):

    if request.user.is_authenticated:
        return redirect('dashboard')

The setup function of the GCBVs saves the request in self.request. You have access to it in every function within the view.

The easiest way that I can think of right off-hand is to override the get method to perform the check and redirect before calling super().

Note, this may not be the cleanest or most appropriate - those decisions would depend upon other factors. One of these factors is whether there are multiple pages that need this type of check.
Also recognize that someone who is registered but not currently logged in can still end up going to your signup page.