Update signature API to support uploads

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-11-05 01:36:00 -04:00
parent 7d4f11b74b
commit f73dd28c92
7 changed files with 413 additions and 153 deletions
+7 -2
View File
@@ -43,7 +43,10 @@ class SignatureBaseModel(models.Model):
date = models.DateField(
blank=True, editable=False, null=True, verbose_name=_('Date signed')
)
key_id = models.CharField(max_length=40, verbose_name=_('Key ID'))
key_id = models.CharField(
help_text=_('ID of the key that will be used to sign the document.'),
max_length=40, verbose_name=_('Key ID')
)
# With proper key
signature_id = models.CharField(
blank=True, editable=False, null=True, max_length=64,
@@ -128,7 +131,9 @@ class EmbeddedSignature(SignatureBaseModel):
@python_2_unicode_compatible
class DetachedSignature(SignatureBaseModel):
signature_file = models.FileField(
blank=True, null=True, storage=storage_detachedsignature,
blank=True, help_text=_(
'Signature file previously generated.'
), null=True, storage=storage_detachedsignature,
upload_to=upload_to, verbose_name=_('Signature file')
)