projects
/
diaspy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
564efb9
)
Better (safer) stringification of users
author
Marek Marecki
<marekjm@ozro.pw>
Sun, 23 Apr 2017 13:43:44 +0000
(15:43 +0200)
committer
Marek Marecki
<marekjm@ozro.pw>
Sun, 23 Apr 2017 13:43:44 +0000
(15:43 +0200)
diaspy/people.py
patch
|
blob
|
blame
|
history
diff --git
a/diaspy/people.py
b/diaspy/people.py
index 701a02c9f1979f6abb87d067ef0aa66618c31c3e..7ebf2a32f4d721050ed5270df50062016f9bad00 100644
(file)
--- a/
diaspy/people.py
+++ b/
diaspy/people.py
@@
-76,10
+76,10
@@
class User():
return self.data[key]
def __str__(self):
- return self
['guid']
+ return self
.data.get('guid', '<guid missing>')
def __repr__(self):
- return '{0} ({1})'.format(self
['handle'], self['guid']
)
+ return '{0} ({1})'.format(self
.handle(), self.guid()
)
def handle(self):
return self.data.get('diaspora_id', 'Unknown handle')