From a276770cdb49f78947550019b05e26fa5f748784 Mon Sep 17 00:00:00 2001
From: chris48s <chris48s@users.noreply.github.com>
Date: Thu, 15 Dec 2022 22:36:46 +0000
Subject: [PATCH] add a clarifying comment to [pypi] getLicenses (#8718)

---
 services/pypi/pypi-helpers.js | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/services/pypi/pypi-helpers.js b/services/pypi/pypi-helpers.js
index 636e1f0f21..a57ea9c4f7 100644
--- a/services/pypi/pypi-helpers.js
+++ b/services/pypi/pypi-helpers.js
@@ -50,6 +50,16 @@ function getLicenses(packageData) {
   const {
     info: { license },
   } = packageData
+
+  /*
+  The .license field may either contain
+  - a short license description (e.g: 'MIT' or 'GPL-3.0') or
+  - the full text of a license
+  but there is nothing in the response that tells us explicitly.
+  We have to make an assumption based on the length.
+  See https://github.com/badges/shields/issues/8689 and
+  https://github.com/badges/shields/pull/8690 for more info.
+  */
   if (license && license.length < 40) {
     return [license]
   } else {
-- 
GitLab