From: Magnus Hagander Date: Tue, 11 Aug 2020 15:39:32 +0000 (+0200) Subject: Don't accidentally delete ssh keys on login X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ecbc938bb1734ac0f2a75e152f2f8031fedd728b;p=pggit.git 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. --- 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