diff --git a/projects/forms.py b/projects/forms.py index 75783c4..0771918 100644 --- a/projects/forms.py +++ b/projects/forms.py @@ -151,6 +151,7 @@ class RealtyForm(forms.ModelForm): class PortfolioForm(forms.ModelForm): duplicate = forms.BooleanField(required=False,label='Some label here') + images_ids = forms.CharField(required=True) class Meta: model = Portfolio diff --git a/projects/views.py b/projects/views.py index ca8d423..f921360 100644 --- a/projects/views.py +++ b/projects/views.py @@ -660,7 +660,7 @@ def contractor_portfolio_create(request): work_sell.contractor = instance.user work_sell.save() - images_ids = request.POST.get('images-ids').split(';')[:-1] + images_ids = request.POST.get('images_ids').split(';')[:-1] for pk in images_ids: picture = Picture.objects.get(pk=pk) temp_file = ContentFile(picture.file.read()) diff --git a/ratings/templatetags/specializtions_tags.py b/ratings/templatetags/specializtions_tags.py index 564e8d5..6ef72bb 100644 --- a/ratings/templatetags/specializtions_tags.py +++ b/ratings/templatetags/specializtions_tags.py @@ -15,6 +15,7 @@ def specialization_widget(context, user_id, class_name=None): 'user_id': user_id, } + @register.inclusion_tag('templatetags/specializations_widget.html', takes_context=True) def specialization_team_widget(context, team_id): team_id = int(team_id) diff --git a/users/templates/contractor_profile.html b/users/templates/contractor_profile.html index b831ce4..4bc6c16 100644 --- a/users/templates/contractor_profile.html +++ b/users/templates/contractor_profile.html @@ -604,6 +604,7 @@ }); location.reload(); } else if (data.status == 'no') { + $.each(data.form_errors, function (k, v) { $('.error-' + k).html(v).show(); }); diff --git a/users/templates/portfolio_create_form.html b/users/templates/portfolio_create_form.html index 557c16d..f8fc71d 100644 --- a/users/templates/portfolio_create_form.html +++ b/users/templates/portfolio_create_form.html @@ -98,7 +98,7 @@ - + @@ -106,6 +106,8 @@