From: CYBERDEViLNL Date: Tue, 10 Apr 2018 21:00:17 +0000 (+0200) Subject: return whole guids instead of a part of it in Notification it's who() function. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c8d695d29792f1ce14677174b9f5c47128f26a6a;p=diaspy.git return whole guids instead of a part of it in Notification it's who() function. --- diff --git a/diaspy/models.py b/diaspy/models.py index 78c721a..6aef929 100644 --- a/diaspy/models.py +++ b/diaspy/models.py @@ -93,7 +93,7 @@ class Aspect(): class Notification(): """This class represents single notification. """ - _who_regexp = re.compile(r'/people/[0-9a-f]+["\']{1} class=["\']{1}hovercardable') + _who_regexp = re.compile(r'/people/([0-9a-f]+)["\']{1} class=["\']{1}hovercardable') _when_regexp = re.compile(r'[0-9]{4,4}(-[0-9]{2,2}){2,2} [0-9]{2,2}(:[0-9]{2,2}){2,2} UTC') _aboutid_regexp = re.compile(r'/posts/[0-9a-f]+') _htmltag_regexp = re.compile('') @@ -135,7 +135,7 @@ class Notification(): def who(self): """Returns list of guids of the users who caused you to get the notification. """ - return [who[8:24] for who in self._who_regexp.findall(self._data['note_html'])] + return [who for who in self._who_regexp.findall(self._data['note_html'])] def when(self): """Returns UTC time as found in note_html.