From f6eec58652b560ca547bc98db182edcaab29cad5 Mon Sep 17 00:00:00 2001 From: Nimish Date: Mon, 13 Oct 2025 22:48:28 +0530 Subject: [PATCH] fix: update ServiceToken and ServiceAccountToken models - Added a deprecation comment for legacy app-linked service tokens in the ServiceToken model. - Updated the expires_at field in the ServiceAccountToken model to allow blank values, enhancing flexibility in token management. --- backend/api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/api/models.py b/backend/api/models.py index 0e3c657ba..fc22d04d0 100644 --- a/backend/api/models.py +++ b/backend/api/models.py @@ -530,7 +530,7 @@ def create(self, *args, **kwargs): raise ValueError("Cannot add more service tokens to this app.") return super().create(*args, **kwargs) - +# Deprecated Legacy App-linked Service Tokens class ServiceToken(models.Model): id = models.TextField(default=uuid4, primary_key=True, editable=False) app = models.ForeignKey(App, on_delete=models.CASCADE) @@ -569,7 +569,7 @@ class ServiceAccountToken(models.Model): created_at = models.DateTimeField(auto_now_add=True, blank=True, null=True) updated_at = models.DateTimeField(auto_now=True) deleted_at = models.DateTimeField(blank=True, null=True) - expires_at = models.DateTimeField(null=True) + expires_at = models.DateTimeField(null=True, blank=True) def clean(self): # Ensure only one of created_by or created_by_service_account is set