Exemple #1
0
    def certificate_mail_creation(self, store, expiration_date):
        for user_desc in db_get_admin_users(store):
            lang = user_desc['language']

            template_vars = {
                'type': 'https_certificate_expiration',
                'expiration_date': expiration_date,
                'node': db_admin_serialize_node(store, lang),
                'notification': db_get_notification(store, lang)
            }

            format_and_send(store, user_desc, template_vars)
def evaluate_update_notification(store, latest_version):
    priv_fact = PrivateFactory(store)
    stored_latest = priv_fact.get_val(u'latest_version')

    if V(stored_latest) < V(latest_version):
        priv_fact.set_val(u'latest_version', latest_version)

        for user_desc in db_get_admin_users(store):
            lang = user_desc['language']
            template_vars = {
                'type': 'software_update_available',
                'latest_version': latest_version,
                'node': db_admin_serialize_node(store, lang),
                'notification': db_get_notification(store, lang),
                'user': user_desc,
            }

            format_and_send(store, user_desc, template_vars)