Optimize returning allowed_ips or 'Any'

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
This commit is contained in:
PieterL75 2022-03-18 15:49:45 +01:00 committed by GitHub
parent b1e0f2d5fa
commit 77c3d67c47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,9 +62,7 @@ class TokenAdmin(admin.ModelAdmin):
]
def list_allowed_ips(self, obj):
if obj.allowed_ips:
return obj.allowed_ips
return 'Any'
return obj.allowed_ips or 'Any'
list_allowed_ips.short_description = "Allowed IPs"