parameters: (self, validated_data)
return_statement: return self._user
docstring: Demo signup/login flow.
docstring_summary: Demo signup/login flow.
docstring_tokens: Demo signup / login flow .
function: def enter_demo(self, validated_data) -> User:
          """Demo signup/login flow."""
  
          # If there's an email collision in signup in the demo environment, we treat it as a login
          matching_user = User.objects.filter(email=validated_data["email"]).first()
          if matching_user is None:
              validated_data["password"] = None
              self._organization, self._team, self._user = User.objects.bootstrap(
                  create_team=self.create_team, **validated_data
              )
          else:
              self._organization, self._team, self._user = matching_user.organization, matching_user.team, matching_user
  
          login(
              self.context["request"], self._user, backend="django.contrib.auth.backends.ModelBackend",
          )
  
          return self._user
function_tokens: def enter_demo ( self , validated_data ) -> User : # If there's an email collision in signup in the demo environment, we treat it as a login matching_user = User . objects . filter ( email = validated_data [ "email" ] ) . first ( ) if matching_user is None : validated_data [ "password" ] = None self . _organization , self . _team , self . _user = User . objects . bootstrap ( create_team = self . create_team , * * validated_data ) else : self . _organization , self . _team , self . _user = matching_user . organization , matching_user . team , matching_user login ( self . context [ "request" ] , self . _user , backend = "django.contrib.auth.backends.ModelBackend" , ) return self . _user