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

Commit 7c2ff3b

Browse files
committed
Fix bug loading moderators into profile
1 parent 98e3fb6 commit 7c2ff3b

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

api/restapi.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def get_node(node):
9191
def get_profile(self, request):
9292
def parse_profile(profile):
9393
if profile is not None:
94+
mods = []
95+
for mod in profile.moderator_list:
96+
mods.apend(mod.encode("hex"))
9497
profile_json = {
9598
"profile": {
9699
"name": profile.name,
@@ -99,7 +102,7 @@ def parse_profile(profile):
99102
"nsfw": profile.nsfw,
100103
"vendor": profile.vendor,
101104
"moderator": profile.moderator,
102-
"moderator_list": profile.moderator_list,
105+
"moderator_list": mods,
103106
"handle": profile.handle,
104107
"about": profile.about,
105108
"website": profile.website,
@@ -323,7 +326,7 @@ def update_profile(self, request):
323326
u.moderator = str_to_bool(request.args["moderator"][0])
324327
if "moderator_list" in request.args:
325328
for moderator in request.args["moderator_list"]:
326-
u.moderator_list.append(moderator)
329+
u.moderator_list.append(unhexlify(moderator))
327330
if "website" in request.args:
328331
u.website = request.args["website"][0]
329332
if "email" in request.args:

protos/objects.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ message Profile {
3535
optional bool nsfw = 5 [default = false];
3636
optional bool vendor = 6 [default = false];
3737
optional bool moderator = 7 [default = false];
38-
repeated bytes moderator_list = 8;
38+
repeated bytes moderator_list = 8;
3939
optional string handle = 9;
4040
optional string about = 10;
4141
optional string short_description = 11;

0 commit comments

Comments
 (0)