summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-02-07 11:00:19 -0300
committerTomás Touceda <chiiph@leap.se>2014-02-07 11:00:19 -0300
commit8ba4f9303cfda51835ece45d77da85f110920042 (patch)
tree75447449ce6dc7bc733e1bba9a0d6413d13a358f /src
parent1b46f9174bbde68e04edd187edfda76183e22c54 (diff)
parent7e8c64770da710c4f9807d7789bae87fa44f4026 (diff)
Merge remote-tracking branch 'refs/remotes/ivan/bug/4995_error-on-every-logout' into develop
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/config/leapsettings.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py
index 91ff83a8..13a1e99e 100644
--- a/src/leap/bitmask/config/leapsettings.py
+++ b/src/leap/bitmask/config/leapsettings.py
@@ -372,12 +372,16 @@ class LeapSettings(object):
Sets the uuid for a given username.
:param username: the full user identifier in the form user@provider
- :type username: basestring
- :param value: the uuid to save
- :type value: basestring
+ :type username: str or unicode
+ :param value: the uuid to save or None to remove it
+ :type value: str or unicode or None
"""
leap_assert("@" in username,
"Expected username in the form user@provider")
user, provider = username.split('@')
- leap_assert(len(value) > 0, "We cannot save an empty uuid")
- self._settings.setValue(self.UUIDFORUSER_KEY % (provider, user), value)
+ key = self.UUIDFORUSER_KEY % (provider, user)
+ if value is None:
+ self._settings.remove(key)
+ else:
+ leap_assert(len(value) > 0, "We cannot save an empty uuid")
+ self._settings.setValue(key, value)