1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Relate SessionKey to UserKey rather than User

This commit is contained in:
Jeremy Stretch
2017-03-14 13:32:07 -04:00
parent b868de8d67
commit 4cb30f1ce4
4 changed files with 30 additions and 15 deletions

View File

@@ -187,7 +187,7 @@ class SessionKey(models.Model):
"""
A SessionKey stores a User's temporary key to be used for the encryption and decryption of secrets.
"""
user = models.OneToOneField(User, related_name='session_key', editable=False)
userkey = models.OneToOneField(UserKey, related_name='session_key', on_delete=models.CASCADE, editable=False)
cipher = models.BinaryField(max_length=512, editable=False)
hash = models.CharField(max_length=128, editable=False)
created = models.DateTimeField(auto_now_add=True)