Commit e7166867 authored by David Seaward's avatar David Seaward

validate user email before generating certificate

parent 8f0b8684
import django.contrib.auth
import paramiko
from celery import shared_task
from celery.utils.log import get_task_logger
......@@ -132,6 +133,22 @@ def update_limit_woo1(ssh, credit):
user = django.contrib.auth.get_user_model().objects.get(
# set user email if missing
credit_has_email = not (credit.additional_data is None or credit.additional_data == "")
user_has_email = not ( is None or == "")
if user_has_email:
elif credit_has_email: = credit.additional_data
raise Exception("No email address for credit.")
# FIXME: should not simply activate an inactive service
credit_days = int(external_bundle.time_credit * credit.quantity)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment