Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 298170e

Browse files
committed
Fix bug loading moderators from db
1 parent ea87e72 commit 298170e

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

api/restapi.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -834,12 +834,14 @@ def set_settings(self, request):
834834
set_value("CONSTANTS", "RESOLVER", resolver)
835835

836836
if "moderators" in request.args:
837-
prev_mods = json.loads(settings.get()[11])
838-
current_mods = request.args["moderators"]
839-
to_add = list(set(current_mods) - set(prev_mods))
840-
to_remove = list(set(prev_mods) - set(current_mods))
841-
if len(to_remove) > 0 or len(to_add) > 0:
842-
self.mserver.update_moderators_on_listings(request.args["moderators"])
837+
mod_json = settings.get()[11]
838+
if mod_json != "":
839+
prev_mods = json.loads(mod_json)
840+
current_mods = request.args["moderators"]
841+
to_add = list(set(current_mods) - set(prev_mods))
842+
to_remove = list(set(prev_mods) - set(current_mods))
843+
if len(to_remove) > 0 or len(to_add) > 0:
844+
self.mserver.update_moderators_on_listings(request.args["moderators"])
843845

844846
settings.update(
845847
request.args["refund_address"][0],

ob.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ testnet_server2 = tcp://libbitcoin2.openbazaar.org:9091,<Z&{.=LJSPySefIKgCu99w.L
2525

2626
[SEEDS]
2727
seed1 = seed.openbazaar.org:8080,5b44be5c18ced1bc9400fe5e79c8ab90204f06bebacc04dd9c70a95eaca6e117
28-

0 commit comments

Comments
 (0)