Fix block inheritance on client/site
This commit is contained in:
		@@ -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):
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user