(self, form)
return super(RegistrationView, self).form_valid(form)
called whene the form was POSTed and its contents were valid
called whene the form was POSTed and its contents were valid
called whene the form was POSTed and its contents were valid
def form_valid(self, form):
        """called whene the form was POSTed and its contents were valid"""

        try:
            user = self.create_user(form)

        except ValidationError as e:
            messages.error(self.request, "; ".join(e.messages))
            return HttpResponseRedirect(reverse("register"))

        except IntegrityError:
            messages.error(self.request, _("Username or email address already in use"))
            return HttpResponseRedirect(reverse("register"))

        send_activation_email(user, self.request)
        return super(RegistrationView, self).form_valid(form)
def form_valid ( self , form ) : try : user = self . create_user ( form ) except ValidationError as e : messages . error ( self . request , "; " . join ( e . messages ) ) return HttpResponseRedirect ( reverse ( "register" ) ) except IntegrityError : messages . error ( self . request , _ ( "Username or email address already in use" ) ) return HttpResponseRedirect ( reverse ( "register" ) ) send_activation_email ( user , self . request ) return super ( RegistrationView , self ) . form_valid ( form )