Added base_url and fixed new account emails

This commit is contained in:
M.Ravi 2017-09-22 13:46:22 +02:00
parent ca73e1bb33
commit 0e5a27862a
3 changed files with 13 additions and 7 deletions

View file

@ -10,13 +10,15 @@ You can activate your Data Center Light account by <a href="{{base_url}}{{activa
You can also copy and paste the following link into the address bar of your browser<br/>
to activate your Data Center Light account.<br/>
{{base_url}}{{activation_link}}
{% endblocktrans %}
{% if account_details %}
{% url 'hosting:reset_password' as reset_password_url %}
<br/><br/>
Your account details are as follows:<br/><br/>
{% blocktrans %}Your account details are as follows:<br/><br/>
Username : Your email address<br/>
Password : {{account_details}}<br/><br/>
You can reset your password here:
{% url 'hosting:reset_password' %}
{% endif %}
{{base_url}}{{reset_password_url}}
{% endblocktrans %}
{% endif %}
{% endblock %}

View file

@ -6,14 +6,16 @@
You can also copy and paste the following link into the address bar of your browser
to activate your Data Center Light account.
{{base_url}}{{activation_link}}
{% endblocktrans %}
{% if account_details %}
Your account details are as follows:
{% url 'hosting:reset_password' as reset_password_url %}
{% blocktrans %}Your account details are as follows:
Username : Your email address
Password : {{account_details}}
You can reset your password here:
{% url 'hosting:reset_password' %}
{% endif %}
{{base_url}}{{reset_password_url}}
{% endblocktrans %}
{% endif %}
{% endblock %}

View file

@ -591,10 +591,12 @@ class OrderConfirmationView(DetailView):
logger.debug(
"Customer {} does not exist.".format(user.get('email')))
password = CustomUser.get_random_password()
base_url = "{0}://{1}".format(self.request.scheme,
self.request.get_host())
custom_user = CustomUser.register(
user.get('name'), password,
user.get('email'),
app='dcl', base_url=None, send_email=True,
app='dcl', base_url=base_url, send_email=True,
account_details=password
)
logger.debug("Created user {}.".format(user.get('email')))