diff --git a/django_lostplaces/lostplaces/forms.py b/django_lostplaces/lostplaces/forms.py index 17e51cc..d075177 100644 --- a/django_lostplaces/lostplaces/forms.py +++ b/django_lostplaces/lostplaces/forms.py @@ -44,7 +44,7 @@ class PlaceForm(forms.ModelForm): fields = '__all__' exclude = ['submitted_by'] -class PlaceImageCreateForm(forms.ModelForm): +class PlaceImageForm(forms.ModelForm): class Meta: model = PlaceImage fields = ['filename'] diff --git a/django_lostplaces/lostplaces/tests/views/test_place_views.py b/django_lostplaces/lostplaces/tests/views/test_place_views.py index 716422a..132c535 100644 --- a/django_lostplaces/lostplaces/tests/views/test_place_views.py +++ b/django_lostplaces/lostplaces/tests/views/test_place_views.py @@ -12,7 +12,7 @@ from lostplaces.views import ( PlaceListView, PlaceDetailView ) -from lostplaces.forms import PlaceImageCreateForm, PlaceForm +from lostplaces.forms import PlaceImageForm, PlaceForm from lostplaces.tests.views import ( ViewTestCase, TaggableViewTestCaseMixin, @@ -49,7 +49,7 @@ class TestPlaceCreateView(ViewTestCase): self.client.login(username='testpeter', password='Develop123') response = self.client.get(reverse('place_create')) - self.assertHasForm(response, 'place_image_form', PlaceImageCreateForm) + self.assertHasForm(response, 'place_image_form', PlaceImageForm) self.assertHasForm(response, 'place_form', PlaceForm) diff --git a/django_lostplaces/lostplaces/views/place_views.py b/django_lostplaces/lostplaces/views/place_views.py index 8809767..18eff0d 100644 --- a/django_lostplaces/lostplaces/views/place_views.py +++ b/django_lostplaces/lostplaces/views/place_views.py @@ -11,7 +11,7 @@ from django.urls import reverse_lazy from lostplaces.models import Place, PlaceImage from lostplaces.views import IsAuthenticatedMixin, IsPlaceSubmitterMixin -from lostplaces.forms import PlaceForm, PlaceImageCreateForm, TagSubmitForm +from lostplaces.forms import PlaceForm, PlaceImageForm, TagSubmitForm from taggit.models import Tag @@ -64,7 +64,7 @@ class PlaceUpdateView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, SuccessMessag class PlaceCreateView(IsAuthenticatedMixin, View): def get(self, request, *args, **kwargs): - place_image_form = PlaceImageCreateForm() + place_image_form = PlaceImageForm() place_form = PlaceForm() context = { @@ -102,7 +102,7 @@ class PlaceCreateView(IsAuthenticatedMixin, View): self.request, 'Please fill in all required fields.' ) - return render(request, 'place/place_create.html', context={'form': form_place}) + return render(request, 'place/place_create.html', context={'form': place_form}) def _apply_multipart_image_upload(self, files, place, submitter): for image in files: