remove MAX_NUM_BETA_ALIASES
This commit is contained in:
Родитель
ec83888b17
Коммит
1f0b61749e
|
@ -20,6 +20,7 @@ SOCKETLABS_API_KEY="dummy-value"
|
|||
SOCKETLABS_VALIDATION_KEY="dummy-value"
|
||||
RELAY_FROM_ADDRESS="relay@127.0.0.1:8000"
|
||||
SITE_ORIGIN="http://127.0.0.1:8000"
|
||||
MAX_NUM_FREE_ALIASES=10
|
||||
TWILIO_ACCOUNT_SID=
|
||||
TWILIO_AUTH_TOKEN=
|
||||
TWILIO_SERVICE_ID=
|
||||
|
|
|
@ -81,7 +81,7 @@ def _index_POST(request):
|
|||
locked_profile = Profile.objects.select_for_update().get(
|
||||
user=user_profile.user
|
||||
)
|
||||
if locked_profile.num_active_address >= settings.MAX_NUM_BETA_ALIASES:
|
||||
if locked_profile.num_active_address >= settings.MAX_NUM_FREE_ALIASES:
|
||||
if 'moz-extension' in request.headers.get('Origin', ''):
|
||||
return HttpResponse('Payment Required', status=402)
|
||||
messages.error(
|
||||
|
|
|
@ -219,7 +219,7 @@ TEMPLATES = [
|
|||
},
|
||||
]
|
||||
|
||||
MAX_NUM_BETA_ALIASES = 5
|
||||
MAX_NUM_FREE_ALIASES = config('MAX_NUM_FREE_ALIASES', None, cast=int)
|
||||
|
||||
WSGI_APPLICATION = 'privaterelay.wsgi.application'
|
||||
|
||||
|
|
|
@ -40,10 +40,10 @@
|
|||
<form action="/emails/" class="dash-create" method="POST">
|
||||
<input type="hidden" name="api_token" value="{{ user.profile_set.first.api_token }}">
|
||||
<button
|
||||
class="blue-btn-states dash-create-new-relay flx al-cntr jst-cntr {%if relay_addresses|length == settings.MAX_NUM_BETA_ALIASES %} btn-disabled {% endif %}"
|
||||
class="blue-btn-states dash-create-new-relay flx al-cntr jst-cntr {%if relay_addresses|length == settings.MAX_NUM_FREE_ALIASES %} btn-disabled {% endif %}"
|
||||
type="submit" value="Generate new alias" data-event-label="Create New Relay Alias"
|
||||
|
||||
{% if relay_addresses|length == settings.MAX_NUM_BETA_ALIASES %}
|
||||
{% if relay_addresses|length == settings.MAX_NUM_FREE_ALIASES %}
|
||||
title="You have reached the alias limit for our beta release."
|
||||
{% else %}
|
||||
title="Generate new alias"
|
||||
|
|
|
@ -6,4 +6,4 @@ register = template.Library()
|
|||
|
||||
@register.simple_tag
|
||||
def remaining_free_aliases(aliases):
|
||||
return settings.MAX_NUM_BETA_ALIASES-len(aliases)
|
||||
return settings.MAX_NUM_FREE_ALIASES-len(aliases)
|
||||
|
|
Загрузка…
Ссылка в новой задаче