diff --git a/client-barcode/freitagslib/network.py b/client-barcode/freitagslib/network.py index ebf77a2..b93d649 100644 --- a/client-barcode/freitagslib/network.py +++ b/client-barcode/freitagslib/network.py @@ -93,7 +93,8 @@ def bulk_buy(buycommands, user_name): 'Content-Length':len(data) } content = _request('buyable/item/bulkbuy/', data, 'POST', headers=headers) - if content != 'Created': + d = json.loads(content) + if not d['success']: raise ValueError('Server says "%s"' % content) @@ -117,7 +118,8 @@ def deposit(amount, transaction_type, user_name): content = _request('account/transactions/transact/', {'user':user_name, 'amount':amount, 'type':transaction_type}, method='POST') - if content != 'OK': + d = json.loads(content) + if not d['success']: raise ValueError('Server says "%s"' % content)