Associate a token with the user that created the application

This commit is contained in:
Xeryus Stokkel 2022-01-17 14:18:43 +01:00
parent 490eb6cbff
commit ce0577744b
Signed by: Xeryus Stokkel
GPG Key ID: 7023C2C891DDE681
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
def set_user_on_application_token(sender, **kwargs):
instance = kwargs['instance']
if kwargs['created'] and not instance.user:
instance.user = sender.user.get_queryset().first()
instance.user = instance.application.user
instance.save()