diff --git a/assets/js/chat.js b/assets/js/chat.js index 66235c7..0be9e0f 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -781,7 +781,7 @@ function dialog (message, yesCallback, notCallback) { console.log(json); $("#review-add").modal('hide'); $("#leaveReview").hide(); - var currOrder = json.project; + var currOrder = json.order; var currRecipent = json.target_user; socket.send_stages_approve({ diff --git a/projects/forms.py b/projects/forms.py index 7beb824..b53ba53 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -83,6 +83,7 @@ class ProjectFilterRealtyForm(forms.ModelForm): self.fields['construction_type'].required = False self.fields['location'].queryset = Location.objects.root_nodes()[0].get_descendants() + self.fields['building_classification'].queryset = BuildingClassfication.objects.root_nodes()[0].get_descendants() # self.fields['location'].queryset = Location.objects # Migrate with this enabled @@ -150,8 +151,8 @@ class CustomerProjectEditForm(forms.ModelForm): class RealtyForm(forms.ModelForm): building_classification = TreeNodeChoiceField( - BuildingClassfication.objects.all(), - label="", initial='', + BuildingClassfication.objects.exclude(name='_root'), + label="ll", initial='', widget=forms.Select(attrs={ 'class': 'selectpicker', 'id': 'realtyBuildingClassificationId' diff --git a/reviews/serializers.py b/reviews/serializers.py index e985c86..99dadee 100644 --- a/reviews/serializers.py +++ b/reviews/serializers.py @@ -7,6 +7,7 @@ from users.serializers import UserSerializer, TeamSerializer class ReviewSerializer(ModelSerializer): target_user = serializers.SerializerMethodField(read_only=True) + order = serializers.SerializerMethodField(read_only=True) class Meta: model = Review @@ -24,8 +25,12 @@ class ReviewSerializer(ModelSerializer): 'target_contractor', 'target_team', 'target_user', + 'order', ) + def get_order(self, obj): + return obj.project.order.pk + def get_target_user(self, obj): if obj.target_customer: return obj.target_customer.pk diff --git a/users/templates/partials/customer_profile_info_block.html b/users/templates/partials/customer_profile_info_block.html index 9438eb7..6599542 100644 --- a/users/templates/partials/customer_profile_info_block.html +++ b/users/templates/partials/customer_profile_info_block.html @@ -1,5 +1,6 @@ {% load specializtions_tags %} {% load thumbnail %} +{% load user_tags %}