This commit is contained in:
groovecoder 2020-11-30 13:52:29 -06:00
Родитель ec83888b17
Коммит 1f0b61749e
5 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -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)