From ecbc938bb1734ac0f2a75e152f2f8031fedd728b Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Tue, 11 Aug 2020 17:39:32 +0200 Subject: [PATCH] Don't accidentally delete ssh keys on login ssh key information is not included when a direct login is done (to not overflow the URL length limit), so don't delete the user ssh key in this case. --- gitadmin/gitadmin/adm/util.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gitadmin/gitadmin/adm/util.py b/gitadmin/gitadmin/adm/util.py index 03f4920..be5453c 100644 --- a/gitadmin/gitadmin/adm/util.py +++ b/gitadmin/gitadmin/adm/util.py @@ -23,6 +23,10 @@ def handle_user_data(sender, **kwargs): user = kwargs.pop('user') userdata = kwargs.pop('userdata') + if 'sshkeys' not in userdata: + # ssh keys are not included on "live logins", only in the background feeds + return + curs = connection.cursor() if userdata.get('sshkeys', None): # We have an ssh key, so update the contents -- 2.39.5