Fix block inheritance on client/site

This commit is contained in:
sadnub
2021-11-10 22:45:25 -05:00
parent 3b6738b547
commit 25a1b464da
2 changed files with 4 additions and 4 deletions

View File

@@ -38,13 +38,15 @@ class AgentSerializer(serializers.ModelSerializer):
client = serializers.ReadOnlyField(source="client.name")
site_name = serializers.ReadOnlyField(source="site.name")
custom_fields = AgentCustomFieldSerializer(many=True, read_only=True)
patches_last_installed = serializers.ReadOnlyField()
last_seen = serializers.ReadOnlyField()
def get_all_timezones(self, obj):
return pytz.all_timezones
class Meta:
model = Agent
exclude = ["last_seen", "id", "patches_last_installed"]
exclude = ["id"]
class AgentTableSerializer(serializers.ModelSerializer):

View File

@@ -115,7 +115,6 @@ export default {
url = `/clients/${this.object.id}/`;
data = {
client: {
pk: this.object.id,
server_policy: this.selectedServerPolicy,
workstation_policy: this.selectedWorkstationPolicy,
block_policy_inheritance: this.blockInheritance,
@@ -125,7 +124,6 @@ export default {
url = `/clients/sites/${this.object.id}/`;
data = {
site: {
pk: this.object.id,
server_policy: this.selectedServerPolicy,
workstation_policy: this.selectedWorkstationPolicy,
block_policy_inheritance: this.blockInheritance,
@@ -186,7 +184,7 @@ export default {
if (this.type !== "agent") {
this.selectedServerPolicy = this.object.server_policy;
this.selectedWorkstationPolicy = this.object.workstation_policy;
this.blockInheritance = this.object.blockInheritance;
this.blockInheritance = this.object.block_policy_inheritance;
} else {
this.selectedAgentPolicy = this.object.policy;
this.blockInheritance = this.object.block_policy_inheritance;