From 858fbb7b5a6fbf2c99df2bc261b5c7f9b6629dcc Mon Sep 17 00:00:00 2001
From: Piotr Gawron <piotr.gawron@uni.lu>
Date: Wed, 13 Dec 2017 11:21:14 +0100
Subject: [PATCH] contacte attempt add form renamed

---
 smash/web/forms/__init__.py              | 4 ++--
 smash/web/forms/contact_attempt_forms.py | 4 ++--
 smash/web/views/contact_attempt.py       | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/smash/web/forms/__init__.py b/smash/web/forms/__init__.py
index 6081d81e..99186b1c 100644
--- a/smash/web/forms/__init__.py
+++ b/smash/web/forms/__init__.py
@@ -2,7 +2,7 @@ from worker_form import WorkerForm
 from forms import VisitDetailForm, \
     VisitAddForm, KitRequestForm, StatisticsForm, AvailabilityAddForm, \
     AvailabilityEditForm, HolidayAddForm
-from contact_attempt_forms import ContactAttemptForm, ContactAttemptEditForm
+from contact_attempt_forms import ContactAttemptAddForm, ContactAttemptEditForm
 from appointment_form import AppointmentDetailForm, AppointmentEditForm, AppointmentAddForm
 from study_subject_forms import StudySubjectAddForm, StudySubjectDetailForm, StudySubjectEditForm
 from subject_forms import SubjectAddForm, SubjectEditForm, SubjectDetailForm
@@ -10,6 +10,6 @@ from voucher_forms import VoucherTypeForm, VoucherTypePriceForm, VoucherForm
 
 __all__ = [StudySubjectAddForm, StudySubjectDetailForm, StudySubjectEditForm, WorkerForm,
            AppointmentDetailForm, AppointmentEditForm, AppointmentAddForm, VisitDetailForm, VisitAddForm,
-           ContactAttemptForm, ContactAttemptEditForm, KitRequestForm, StatisticsForm, AvailabilityAddForm,
+           ContactAttemptAddForm, ContactAttemptEditForm, KitRequestForm, StatisticsForm, AvailabilityAddForm,
            AvailabilityEditForm, HolidayAddForm, SubjectAddForm, SubjectEditForm, SubjectDetailForm, VoucherTypeForm,
            VoucherTypePriceForm, VoucherForm]
diff --git a/smash/web/forms/contact_attempt_forms.py b/smash/web/forms/contact_attempt_forms.py
index b91cd78c..6902b36a 100644
--- a/smash/web/forms/contact_attempt_forms.py
+++ b/smash/web/forms/contact_attempt_forms.py
@@ -6,7 +6,7 @@ from web.forms.forms import DATETIMEPICKER_DATE_ATTRS
 from web.models import ContactAttempt, Worker
 
 
-class ContactAttemptForm(ModelForm):
+class ContactAttemptAddForm(ModelForm):
     datetime_when = forms.DateTimeField(label='When? (YYYY-MM-DD HH:MM)',
                                         widget=forms.DateTimeInput(DATETIMEPICKER_DATE_ATTRS)
                                         )
@@ -23,7 +23,7 @@ class ContactAttemptForm(ModelForm):
         if self.user is None:
             raise TypeError("Worker not defined for: " + user.username)
         subject = kwargs.pop('subject', None)
-        super(ContactAttemptForm, self).__init__(*args, **kwargs)
+        super(ContactAttemptAddForm, self).__init__(*args, **kwargs)
         self.fields['subject'].initial = subject.id
         self.fields['subject'].disabled = True
         self.fields['worker'].initial = self.user
diff --git a/smash/web/views/contact_attempt.py b/smash/web/views/contact_attempt.py
index f4e7c14a..40d66ae2 100644
--- a/smash/web/views/contact_attempt.py
+++ b/smash/web/views/contact_attempt.py
@@ -1,6 +1,6 @@
 from django.shortcuts import redirect, get_object_or_404
 
-from web.forms import ContactAttemptForm, ContactAttemptEditForm
+from web.forms import ContactAttemptAddForm, ContactAttemptEditForm
 from web.models import StudySubject, ContactAttempt
 from . import wrap_response
 
@@ -8,7 +8,7 @@ from . import wrap_response
 def contact_add(request, subject_id):
     subject = get_object_or_404(StudySubject, id=subject_id)
     if request.method == 'POST':
-        form = ContactAttemptForm(request.POST, user=request.user, subject=subject)
+        form = ContactAttemptAddForm(request.POST, user=request.user, subject=subject)
         form.instance.subject_id = subject_id
         if form.is_valid():
             form.save()
@@ -17,7 +17,7 @@ def contact_add(request, subject_id):
             else:
                 return redirect('web.views.subject_edit', id=subject_id)
     else:
-        form = ContactAttemptForm(user=request.user, subject=subject)
+        form = ContactAttemptAddForm(user=request.user, subject=subject)
 
     return wrap_response(request, 'contact_attempt/add.html',
                          {'form': form, 'subject_id': subject_id})
-- 
GitLab