Skip to content

Commit b049330

Browse files
committed
Add version
1 parent 103a8e1 commit b049330

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.10 on 2024-02-21 09:59
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("rest_framework_sso", "0004_sessiontoken_created_by"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="sessiontoken",
15+
name="version",
16+
field=models.CharField(blank=True, max_length=100, null=True),
17+
),
18+
]

rest_framework_sso/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class SessionToken(models.Model):
3131
client_id = models.CharField(max_length=1000, blank=True)
3232
ip_address = models.GenericIPAddressField(null=True, blank=True, db_index=True)
3333
user_agent = models.CharField(max_length=1000, blank=True)
34+
version = models.CharField(max_length=100, blank=True, null=True)
3435
last_used_at = models.DateTimeField(null=True, blank=True, db_index=True)
3536
created_by = models.ForeignKey(
3637
to=AUTH_USER_MODEL,
@@ -70,3 +71,5 @@ def update_attributes(self, request):
7071
self.user_agent = request.META.get("HTTP_USER_AGENT")[:1000]
7172
else:
7273
self.user_agent = ""
74+
75+
self.version = getattr(request, "version", None)

0 commit comments

Comments
 (0)