summaryrefslogtreecommitdiff
path: root/archaeological_files/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_files/forms.py')
-rw-r--r--archaeological_files/forms.py24
1 files changed, 1 insertions, 23 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py
index b97ca9f15..755c565f2 100644
--- a/archaeological_files/forms.py
+++ b/archaeological_files/forms.py
@@ -33,7 +33,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from ishtar_common.models import Person, PersonType, Town, Organization, \
- OrganizationType, valid_id, is_unique, DocumentTemplate
+ OrganizationType, valid_id, is_unique
from archaeological_operations.models import ActType, AdministrativeAct
import models
from ishtar_common.forms import FinalForm, FormSet, ClosingDateFormSelection, \
@@ -224,28 +224,6 @@ class FinalFileDeleteForm(FinalForm):
confirm_msg = " "
confirm_end_msg = _(u"Would you like to delete this archaelogical file ?")
-class DocumentGenerationAdminActForm(forms.Form):
- _associated_model = AdministrativeAct
- document_template = forms.ChoiceField(label=_("Template"), choices=[])
-
- def __init__(self, *args, **kwargs):
- super(DocumentGenerationAdminActForm, self).__init__(*args, **kwargs)
- self.fields['document_template'].choices = DocumentTemplate.get_tuples(
- dct={'associated_object_name':
- 'archaeological_operations.models.AdministrativeAct'})
-
- def save(self, object_pk):
- try:
- c_object = self._associated_model.objects.get(pk=object_pk)
- except self._associated_model.DoesNotExist:
- return
- try:
- template = DocumentTemplate.objects.get(
- pk=self.cleaned_data.get('document_template'))
- except DocumentTemplate.DoesNotExist:
- return
- return template.publish(c_object)
-
class AdministrativeActFileSelect(TableSelect):
associated_file__towns = get_town_field()
act_type = forms.ChoiceField(label=_("Act type"), choices=[])