summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-23 18:38:49 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-23 18:38:49 +0100
commit28460d2f6fb09b25f5e997ee68afaefbbc81b07a (patch)
tree10f36181742c7a6e01c764373b3d6cfcfbc52b4f
parenta84769890b266eaab5f209f595361bd9ee9c241b (diff)
downloadpoezio-28460d2f6fb09b25f5e997ee68afaefbbc81b07a.tar.gz
poezio-28460d2f6fb09b25f5e997ee68afaefbbc81b07a.tar.bz2
poezio-28460d2f6fb09b25f5e997ee68afaefbbc81b07a.tar.xz
poezio-28460d2f6fb09b25f5e997ee68afaefbbc81b07a.zip
Fix a crash on unknown role
-rw-r--r--src/user.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/user.py b/src/user.py
index 82d74193..395d522b 100644
--- a/src/user.py
+++ b/src/user.py
@@ -26,6 +26,7 @@ import curses
import theme
ROLE_DICT = {
+ '':0,
'none':0,
'visitor':1,
'participant':2,
@@ -47,6 +48,8 @@ class User(object):
self.affiliation = affiliation
self.show = show
self.status = status
+ if role not in ROLE_DICT: # avoid unvalid roles
+ role = ''
self.role = role
def change_nick(self, nick):