T
T
tarp202021-06-09 12:59:00
Django
tarp20, 2021-06-09 12:59:00

Where is the token creation error?

there is a function to get the token
but it doesn't pass correctly

def get_message_token(self) -> str:
        """ Get message token from database """
        _name = "get_message_token"

        try:
            company_object = userModels.Company.objects.get(
                id=self.meeting["company"])
            token = models.MessageToken.objects.get(
                company=company_object).token
            libenv._debug(
                f"[*] {__name__}: {_name}: \
                    Company {company_object} assigned token: {token}")
            return token
        except models.MessageToken.DoesNotExist:
            token = models.MessageToken.objects.get(is_default=True).token
            libenv._debug(
                f"[*] {__name__}: {_name}: \
                    Default token assigned for \
                        {self.meeting['company']}: {token.token}")
            return token
        except Exception as e:
            raise e


how to do that if there is no token in the database, then it transmitted info that the token is missing

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question