fix ABID generation consistency when self._state.adding is True
Some checks are pending
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run

This commit is contained in:
Nick Sweeting 2024-08-20 05:56:19 -07:00
parent 9d2116ad9a
commit 4ae186dfca
No known key found for this signature in database
4 changed files with 91 additions and 33 deletions

View file

@ -55,11 +55,9 @@ class APIToken(ABIDModel):
def __json__(self) -> dict:
return {
"TYPE": "APIToken",
"uuid": str(self.id),
"ulid": str(self.ulid),
"abid": str(self.get_abid()),
"user_id": str(self.user.id),
"user_username": self.user.username,
"id": str(self.pk),
"abid": str(self.ABID),
"created_by_id": str(self.created_by_id),
"token": self.token,
"created": self.created.isoformat(),
"expires": self.expires_as_iso8601,