From 06ddc6a3058aeb01119ed749b33e8e19d2de384e Mon Sep 17 00:00:00 2001 From: c0de Date: Thu, 1 Jun 2017 21:33:55 -0500 Subject: [PATCH] apps: Truncate the api key to 15 characters + ... --- core/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/models.py b/core/models.py index 7b8cb4f..8ae4a31 100644 --- a/core/models.py +++ b/core/models.py @@ -31,7 +31,9 @@ class api_apps(models.Model): settings = JSONField(blank=True) def __str__(self): - return '%s (%s) - %s' % (self.name, self.owner.name, self.apikey) + # Truncate the api key to the first 15 characters for identification + thekey = self.apikey[:15] + (self.apikey[:15] and '...') + return '%s (%s) - %s' % (self.name, self.owner.user.username, thekey) @python_2_unicode_compatible