define the BBS_Failure exception
diff --git a/xos/observers/vcpe/broadbandshield.py b/xos/observers/vcpe/broadbandshield.py
index 4fd6def..96f9944 100644
--- a/xos/observers/vcpe/broadbandshield.py
+++ b/xos/observers/vcpe/broadbandshield.py
@@ -2,6 +2,7 @@
import logging
import json
import sys
+from rest_framework.exceptions import APIException
""" format of settings
@@ -44,6 +45,13 @@
["allowlist"] - []
"""
+class BBS_Failure(APIException):
+ status_code=400
+ def __init__(self, why="broadbandshield error", fields={}):
+ APIException.__init__(self, {"error": "BBS_Failure",
+ "specific_error": why,
+ "fields": fields})
+
class BBS:
level_map = {"PG_13": "PG-13",
@@ -233,8 +241,14 @@
open("bbs.json","w").write(json.dumps(bbs.settings))
+ # a new BBS account will throw a 500 error if it has no rating
+ bbs.settings["settings"]["rating"] = "R"
+ #bbs.settings["settings"]["category"] = [u'PORNOGRAPHY', u'ADULT', u'ILLEGAL', u'WEAPONS', u'DRUGS', u'GAMBLING', u'CYBERBULLY', u'ANONYMIZERS', u'SUICIDE', u'MALWARE']
+ #bbs.settings["settings"]["blocklist"] = []
+ #bbs.settings["settings"]["allowlist"] = []
+ #for water in bbs.settings["settings"]["watershed"];
+ # water["categories"]=[]
# delete everything
- bbs.settings["rating"] = "R"
bbs.post_account()
bbs.clear_users_and_devices()