diff options
| author | 2021-02-12 00:20:51 -0800 | |
|---|---|---|
| committer | 2021-02-12 00:20:51 -0800 | |
| commit | 2a9f349429694d48cca86af972ef327a57af552d (patch) | |
| tree | 1c04f9974a1727087aff2b7d72f3990d099d537c | |
| parent | Empty fields have been accounted for by getting usually non-empty ones. (diff) | |
Accounting for completely empty fields that only contain whitespaces.
| -rw-r--r-- | bot/exts/info/pypi.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bot/exts/info/pypi.py b/bot/exts/info/pypi.py index 7a5d7f4b7..990a5c905 100644 --- a/bot/exts/info/pypi.py +++ b/bot/exts/info/pypi.py @@ -37,7 +37,8 @@ class PyPi(Cog): embed.description = f"[{info['name']} v{info['version']}]({info['package_url']})\n" for field in FIELDS: - if field_value := info[field]: + # Field could be completely empty, in some cases can be a string with whitespaces. + if field_value := info[field].strip(): embed.add_field( name=field.replace("_", " ").title(), value=field_value, |