Reorganize and sort models and managers according to Mayan's best practices.

Signed-off-by: Michael Price <loneviking72@gmail.com>
This commit is contained in:
Michael Price
2018-03-13 15:56:40 -04:00
committed by Roberto Rosario
parent a172538dfc
commit 28aa0b913c
21 changed files with 418 additions and 418 deletions

View File

@@ -61,6 +61,9 @@ class Key(models.Model):
verbose_name = _('Key')
verbose_name_plural = _('Keys')
def __str__(self):
return '{} - {}'.format(self.key_id, self.user_id)
def clean(self):
import_results = gpg_backend.import_key(key_data=self.key_data)
@@ -93,9 +96,6 @@ class Key(models.Model):
super(Key, self).save(*args, **kwargs)
def __str__(self):
return '{} - {}'.format(self.key_id, self.user_id)
def sign_file(self, file_object, passphrase=None, clearsign=False, detached=False, binary=False, output=None):
# WARNING: using clearsign=True and subsequent decryption corrupts the
# file. Appears to be a problem in python-gnupg or gpg itself.