Changeset - 4d92fdd67af4
[Not reviewed]
default
0 3 0
Dennis Fink - 10 years ago 2015-02-16 18:42:38
dennis.fink@c3l.lu
Updated gnupg code
3 files changed with 9 insertions and 5 deletions:
0 comments (0 inline, 0 general)
ennstatus/__init__.py
Show inline comments
 
@@ -47,6 +47,7 @@ def create_app():
 

	
 
    if 'ENNSTATUS_GPG_HOME' in app.config:
 
        gpg = gnupg.GPG(gnupghome=app.config['ENNSTATUS_GPG_HOME'])
 
        gpg.encoding = 'utf-8'
 
        app.extensions['gnupg'] = gpg
 
    else:
 
        app.extensions['gnupg'] = False
ennstatus/root/functions.py
Show inline comments
 
@@ -25,10 +25,13 @@ def send_membership_mail(form):
 
                               country=form.country.data,
 
                               gpg=form.gpg.data
 
                               )
 

	
 
        current_app.logger.debug('Before encryption')
 
        current_app.logger.debug(body)
 
        if current_app.extensions['gnupg']:
 
            body = current_app.extensions['gnupg'].encrypt(body, recipient,
 
                                                           always_trust=True)
 
            body = str(current_app.extensions['gnupg'].encrypt(body, recipient,
 
                                                               always_trust=True))
 
            current_app.logger.debug('After encryption')
 
            current_app.logger.debug(body)
 
        msg.body = body
 

	
 
        mail.send(msg)
ennstatus/status/functions.py
Show inline comments
 
@@ -27,8 +27,8 @@ def _send_mail(server_name, last_updated
 
                % (server_name, last_updated))
 

	
 
        if current_app.extensions['gnupg']:
 
            body = current_app.extensions['gnupg'].encrypt(body, recipient,
 
                                                           always_trust=True)
 
            body = str(current_app.extensions['gnupg'].encrypt(body, recipient,
 
                                                           always_trust=True))
 
        msg.body = body
 

	
 
        mail.send(msg)
0 comments (0 inline, 0 general)