aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/model/address.py
diff options
context:
space:
mode:
authorJ08nY2017-06-22 19:12:04 +0200
committerJ08nY2017-06-22 19:12:04 +0200
commit5014e7a75f02f8c707847122ff43b37064247a43 (patch)
tree19bda52a1507fa7fe09e051ccee0129aace62d85 /src/mailman_pgp/model/address.py
parent429234b8db28ed6aadf21a3ccfce7eaf7065be71 (diff)
downloadmailman-pgp-5014e7a75f02f8c707847122ff43b37064247a43.tar.gz
mailman-pgp-5014e7a75f02f8c707847122ff43b37064247a43.tar.zst
mailman-pgp-5014e7a75f02f8c707847122ff43b37064247a43.zip
Document classes, methods, modules.
Diffstat (limited to 'src/mailman_pgp/model/address.py')
-rw-r--r--src/mailman_pgp/model/address.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mailman_pgp/model/address.py b/src/mailman_pgp/model/address.py
index 60c6e2f..1dc3840 100644
--- a/src/mailman_pgp/model/address.py
+++ b/src/mailman_pgp/model/address.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
-""""""
+"""Model for PGP enabled addresses."""
from os.path import exists, isfile, join
@@ -29,6 +29,8 @@ from mailman_pgp.model.base import Base
class PGPAddress(Base):
+ """A PGP enabled address."""
+
__tablename__ = 'pgp_addresses'
id = Column(Integer, primary_key=True)
@@ -46,6 +48,8 @@ class PGPAddress(Base):
@property
def key(self):
+ if self.key_fingerprint is None:
+ return None
if self._key is None:
if exists(self.key_path) and isfile(self.key_path):
self._key, _ = PGPKey.from_file(self.key_path)
@@ -53,5 +57,7 @@ class PGPAddress(Base):
@property
def key_path(self):
+ if self.key_fingerprint is None:
+ return None
return join(config.pgp.keydir_config['user_keydir'],
self.key_fingerprint + '.asc')