mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
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:
committed by
Tim Abbott
parent
7a26c41c42
commit
e10d413476
@@ -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.
|
||||
|
Reference in New Issue
Block a user