only need to allocate a bbs_account if URL filtering is enabled
diff --git a/xos/cord/models.py b/xos/cord/models.py
index 7eb8581..c491a54 100644
--- a/xos/cord/models.py
+++ b/xos/cord/models.py
@@ -543,9 +543,16 @@
if self.deleted:
return
- if not self.bbs_account:
- self.bbs_account = self.provider_service.allocate_bbs_account()
- super(VCPETenant, self).save()
+ if self.url_filter_enable:
+ if not self.bbs_account:
+ # make sure we use the proxied VCPEService object, not the generic Service object
+ vcpe_service = VCPEService.objects.get(id=self.provider_service.id)
+ self.bbs_account = vcpe_service.allocate_bbs_account()
+ super(VCPETenant, self).save()
+ else:
+ if self.bbs_account:
+ self.bbs_account = None
+ super(VCPETenant, self).save()
def save(self, *args, **kwargs):
if not self.creator:
diff --git a/xos/core/xoslib/templates/xosCordSubscriber.html b/xos/core/xoslib/templates/xosCordSubscriber.html
index 7a8abe0..6a8105e 100644
--- a/xos/core/xoslib/templates/xosCordSubscriber.html
+++ b/xos/core/xoslib/templates/xosCordSubscriber.html
@@ -19,11 +19,11 @@
<tr><td class="xos-label-cell xos-cord-label">Id:</td><td><%= model.attributes.vcpe_id %></td></tr>
<tr><td class="xos-label-cell xos-cord-label">Image:</td><td><%= model.attributes.image_name %></td></tr>
<tr><td class="xos-label-cell xos-cord-label">Sliver Id:</td><td><%= model.attributes.sliver %></td></tr>
- <tr><td class="xos-label-cell xos-cord-label">BBS Account:</td><td><%= model.attributes.bbs_account %></td></tr>
<tr><td class="xos-label-cell xos-cord-label">Firewall:</td><td><input type="checkbox" name="firewall_enable" <% if (model.attributes.firewall_enable) print("checked"); %>>Enable<br>
<textarea name="firewall_rules" style="width:320px; height:80px"><%= model.attributes.firewall_rules %></textarea></td></tr>
<tr><td class="xos-label-cell xos-cord-label">URL Filter:</td><td><input type="checkbox" name="url_filter_enable" <% if (model.attributes.url_filter_enable) print("checked"); %>>Enable<br>
- <textarea name="url_filter_rules" style="width:320px; height:80px"><%= model.attributes.url_filter_rules %></textarea></td></tr>
+ <textarea name="url_filter_rules" style="width:320px; height:80px"><%= model.attributes.url_filter_rules %></textarea><br>
+ BBS Account: <%= model.attributes.bbs_account %></td></tr>
<tr><td class="xos-label-cell xos-cord-label">CDN:</td><td><input type="checkbox" name="cdn_enable" <% if (model.attributes.cdn_enable) print("checked"); %>>Enable</td></tr>
<tr><td class="xos-label-cell xos-cord-label">Addresses:</td><td><%= model.attributes.wan_ip %> (wan)<br>
<%= model.attributes.lan_ip %> (lan)<br>