diff options
author | Sebastian Reichel <sre@ring0.de> | 2018-07-16 01:36:01 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2018-07-17 12:17:08 +0200 |
commit | 60e7aea9c4501213f8710b0f14bf3e3ba35e8d7a (patch) | |
tree | e206affebbdee63f65fb8443111f5ba1bc15d4bc /src | |
parent | d6cc1e7da591f784bddecce19e12097de88d0fe8 (diff) | |
download | serial-barcode-scanner-60e7aea9c4501213f8710b0f14bf3e3ba35e8d7a.tar.bz2 |
Fix display of Guest purchases
Diffstat (limited to 'src')
-rw-r--r-- | src/scanner-session/scannersession.vala | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/scanner-session/scannersession.vala b/src/scanner-session/scannersession.vala index cf308ce..494ecbd 100644 --- a/src/scanner-session/scannersession.vala +++ b/src/scanner-session/scannersession.vala @@ -59,13 +59,19 @@ public class ScannerSessionImplementation { private bool login(int user) throws DBusError, IOError { this.user = user; - try { - this.name = db.get_username(user); - this.disabled = db.user_is_disabled(user); - } catch(DatabaseError e) { - send_message(MessageType.ERROR, _("Error (user=%d): %s"), user, e.message); - return false; + if (user != 0) { + try { + this.name = db.get_username(user); + this.disabled = db.user_is_disabled(user); + } catch(DatabaseError e) { + send_message(MessageType.ERROR, _("Error (user=%d): %s"), user, e.message); + return false; + } + } else { + this.name = _("Guest"); + this.disabled = false; } + this.logged_in = true; try { |