RemotePushDevice: Migrate token_kind from IntegerChoices to TextChoices.

Improves code readability by using string values ("apns", "fcm")
instead of integers (1, 2).
This commit is contained in:
Prakhar Pratyush
2025-07-09 18:42:38 +05:30
committed by Tim Abbott
parent 7a26c41c42
commit e10d413476
2 changed files with 21 additions and 4 deletions

View File

@@ -618,11 +618,11 @@ class RemotePushDevice(models.Model):
# that they're at most the maximum FCM / APNs payload size of 4096 bytes.
token = models.CharField(max_length=4096)
class TokenKind(models.IntegerChoices):
APNS = 1, "APNs"
FCM = 2, "FCM"
class TokenKind(models.TextChoices):
APNS = "apns", "APNs"
FCM = "fcm", "FCM"
token_kind = models.PositiveSmallIntegerField(choices=TokenKind.choices)
token_kind = models.CharField(max_length=4, choices=TokenKind.choices)
# 64-bit random integer ID generated by the client; will only be
# guaranteed to be unique within the client's own table of accounts.