# HG changeset patch # User Paul Boddie # Date 1370562868 -7200 # Node ID 880d5796bf8dc78ae3adc7faeddc65742c3ac718 # Parent c1bc017b647a700d400f063fbb5b6bda64ea02b0 Fixed the failure case of get_homedir and made a separate function to obtain the configuration value. diff -r c1bc017b647a -r 880d5796bf8d MoinMessageSupport.py --- a/MoinMessageSupport.py Fri Jun 07 01:34:51 2013 +0200 +++ b/MoinMessageSupport.py Fri Jun 07 01:54:28 2013 +0200 @@ -232,10 +232,19 @@ "Locate the GPG home directory." - homedir = getattr(self.request.cfg, "moinmessage_gpg_homedir") + request = self.request + homedir = get_homedir(self.request) + if not homedir: writeHeaders(request, "text/plain", getMetadata(self.page), "415 Unsupported Media Type") request.write("Encoded data cannot currently be understood. Please notify the site administrator.") + return homedir +def get_homedir(request): + + "Locate the GPG home directory." + + return getattr(request.cfg, "moinmessage_gpg_homedir") + # vim: tabstop=4 expandtab shiftwidth=4