Intervention revocation

* adds Revocation model to interventions/models.py
* adds revocations to interventions detail view
* fixes duplicated ids in html includes
* refactors controls for detail view into included template files (controls.html)
* reduces max length for payment transfer notes from 1000 to 200
* adds RevocationAdmin to intervention/admin.py
* adds new form for adding a Revocation to an intervention's legal_data
  * only one revocation per intervention possible
  * removes add button in case of an existing revocation
* adds revocation routes to intervention app
* renames document field in Document model into file for more clarity
* adds/updates translations
This commit is contained in:
mipel
2021-08-04 13:32:35 +02:00
parent fd526b80b7
commit 8e1f679c2a
25 changed files with 495 additions and 197 deletions

View File

@@ -300,7 +300,7 @@ class NewDocumentForm(BaseModalForm):
self.form_caption = _("")
self.template = "modal/modal_form.html"
self.form_attrs = {
"enctype": "multipart/form-data",
"enctype": "multipart/form-data", # important for file upload
}
def save(self):

View File

@@ -98,7 +98,7 @@ class Document(BaseResource):
"""
title = models.CharField(max_length=500, null=True, blank=True)
date_of_creation = models.DateField()
document = models.FileField()
file = models.FileField()
comment = models.TextField()
def delete(self, using=None, keep_parents=False):
@@ -111,7 +111,7 @@ class Document(BaseResource):
Returns:
"""
os.remove(self.document.file.name)
os.remove(self.file.file.name)
super().delete(using=using, keep_parents=keep_parents)

View File

@@ -38,8 +38,8 @@ ALLOWED_HOSTS = []
LOGIN_URL = "/login/"
# Session settings
SESSION_COOKIE_AGE = 30 * 60 # 30 minutes
SESSION_SAVE_EVERY_REQUEST = True
#SESSION_COOKIE_AGE = 30 * 60 # 30 minutes
#SESSION_SAVE_EVERY_REQUEST = True
# Application definition
@@ -149,7 +149,7 @@ LANGUAGE_CODE = 'de'
USE_THOUSAND_SEPARATOR = True
DEFAULT_DATE_TIME_FORMAT = '%d.%m.%Y %H:%M:%S'
DATE_FORMAT = '%d.%m.%Y'
DEFAULT_DATE_FORMAT = '%d.%m.%Y'
TIME_ZONE = 'Europe/Berlin'