def _generate_username(self):
        while True:
            # Generate a UUID username, removing dashes and the last 2 chars
            # to make it fit into the 30 char User.username field. Gracefully
            # handle any unlikely, but possible duplicate usernames.
            username = str(uuid.uuid4())
            username = username.replace('-', '')
            username = username[:-2]

            try:
                User.objects.get(username=username)
            except User.DoesNotExist:
                return username
View that the external payment provider calls when a payment is succesful.
dataset/ETHPy150Open stephrdev/django-userprofiles/userprofiles/forms.py/RegistrationForm._generate_username--crossover with--dataset/ETHPy150Open thomasWajs/cartridge-external-payment/cartridge_external_payment/views.py/payment_notification