From 492f1d8aa5c25ea6745219689c47376fe5b92ed7 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Thu, 4 Jun 2020 10:25:00 -0500 Subject: [PATCH] Expand URL'S in profile bios --- src/controller/user.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controller/user.py b/src/controller/user.py index 8766a890..665c5ad5 100644 --- a/src/controller/user.py +++ b/src/controller/user.py @@ -100,6 +100,10 @@ class profileController(object): if self.data["url"] != None: string = string+ _(u"URL: %s\n") % (self.data["entities"]["url"]["urls"][0]["expanded_url"]) if self.data["description"] != "": + if self.data["entities"].get("description") != None and self.data["entities"]["description"].get("urls"): + for url in self.data["entities"]["description"]["urls"]: + if url["url"] in self.data["description"]: + self.data["description"] = self.data["description"].replace(url["url"], url["expanded_url"]) string = string+ _(u"Bio: %s\n") % (self.data["description"]) if self.data["protected"] == True: protected = _(u"Yes") else: protected = _(u"No")