Skip to content

Commit 89ddeb5

Browse files
committed
Remove serialisation methods of DeviceGrant class
It seems useless to think of serialisation of DeviceGrant objects, since they are by design ephemeral. The equivalent "grant" classes for other grant_types, such as "class Grant(AbstractGrant)" does not have these methods defined either. Therefore, best to remove them.
1 parent 8653550 commit 89ddeb5

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

oauth2_provider/models.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -713,20 +713,10 @@ def is_expired(self):
713713
return False
714714

715715

716-
class DeviceManager(models.Manager):
717-
def get_by_natural_key(self, client_id, device_code, user_code):
718-
return self.get(client_id=client_id, device_code=device_code, user_code=user_code)
719-
720-
721716
class DeviceGrant(AbstractDeviceGrant):
722-
objects = DeviceManager()
723-
724717
class Meta(AbstractDeviceGrant.Meta):
725718
swappable = "OAUTH2_PROVIDER_DEVICE_GRANT_MODEL"
726719

727-
def natural_key(self):
728-
return (self.client_id, self.device_code, self.user_code)
729-
730720

731721
@dataclass
732722
class DeviceRequest:

0 commit comments

Comments
 (0)