return whole guids instead of a part of it in Notification it's who() function.
authorCYBERDEViLNL <CYBERDEViLNL@github.com>
Tue, 10 Apr 2018 21:00:17 +0000 (23:00 +0200)
committerCYBERDEViLNL <CYBERDEViLNL@github.com>
Tue, 10 Apr 2018 21:00:17 +0000 (23:00 +0200)
diaspy/models.py

index 78c721a7d15ca4228d7123898f2e7c353679d94d..6aef929c799be8c2cbf25ecb204138e44716a9c3 100644 (file)
@@ -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('</?[a-z]+( *[a-z_-]+=["\'].*?["\'])* */?>')
@@ -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.