Anton Khimich 80b1d02b2f
Fix gpg key deletion (#14561)
* Fix GPG key deletion when user is deleted

Per #14531, deleting a user account will delete the user's GPG keys
from the `gpg_key` table but not from `gpg_key_import`, which causes
an error when creating an account with the same email and attempting
to re-add the same key. This commit deletes all entries from
`gpg_key_import` that match any GPG key IDs belonging to the user.

* Format added code in models/user.go

* Create a new function for listing GPG keys and apply it

Create a new function `listGPGKeys` and replace a previous use
of `ListGPGKeys`. Thanks to @6543 for the patch.

Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca>
Co-authored-by: 6543 <6543@obermui.de>
2021-02-04 17:16:21 +08:00
..
2020-03-22 11:12:55 -04:00
2020-04-05 07:20:50 +01:00
2020-12-27 21:58:03 +02:00
2020-12-09 01:12:15 +01:00
2020-06-15 16:46:01 -04:00
2017-05-04 13:54:56 +08:00
2021-02-04 17:16:21 +08:00
2020-04-05 07:20:50 +01:00
2019-12-15 16:57:34 -05:00
2020-08-24 11:48:15 -04:00
2020-10-31 01:36:46 -04:00
2020-04-05 07:20:50 +01:00
2020-08-16 23:07:38 -04:00
2020-08-16 23:07:38 -04:00
2020-08-16 23:07:38 -04:00
2020-12-27 21:58:03 +02:00
2020-10-20 14:18:25 -04:00
2020-04-05 07:20:50 +01:00
2020-08-16 23:07:38 -04:00
2020-03-02 00:05:44 +02:00
2021-01-02 18:01:09 +00:00
2020-04-05 07:20:50 +01:00
2020-12-27 21:58:03 +02:00
2019-06-12 15:41:28 -04:00
2021-02-04 17:16:21 +08:00