trial on signup

master
alice 4 years ago
parent ada7b615b9
commit ec5e8d4230

@ -299,6 +299,7 @@ CONSTANCE_CONFIG = {
'WIREGUARD_PUBKEY': ("", "WireGuard server public key"),
'WIREGUARD_PSK': ("", "WireGuard pre-shared key (optional)"),
'WIREGUARD_DNS': ("10.128.0.1", "WireGuard DNS server IP address"),
'TRIAL_ON_SIGNUP': (6, "Hours of trial to give on signup"),
}
CONSTANCE_ADDITIONAL_FIELDS = {

@ -93,6 +93,10 @@ def signup(request):
user.vpnuser.campaign = request.session.get('campaign')
if site_config.TRIAL_ON_SIGNUP:
trial_time = timedelta(hours=site_config.TRIAL_ON_SIGNUP)
user.vpnuser.add_paid_time(trial_time)
user.vpnuser.save()
user.vpnuser.lcore_sync()

@ -167,7 +167,7 @@
<div class="content-box account-trial">
<p>
{% blocktrans trimmed with left=user.vpnuser. %}
For up to one week, you can activate your free trial for the next two hours by clicking on this button:
For up to one week, you can activate your free trial for two hours by clicking on this button:
{% endblocktrans %}
</p>
<form action="/account/trial" method="post" class="pure-form" name="trial_form">

Loading…
Cancel
Save