Skip to content

Commit d09c825

Browse files
committed
chore(passport): change register to registration
1 parent c4713ac commit d09c825

10 files changed

Lines changed: 25 additions & 25 deletions

File tree

charts/passport/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ environment:
1515
## General settings
1616
# DRYCC_DEBUG: False
1717
# ADMIN_ENABLED: False
18-
# REGISTER_ENABLED: False
18+
# REGISTRATION_ENABLED: False
1919
## LDAP setting
2020
# LDAP_ENDPOINT: ""
2121
# LDAP_BIND_DN: ""

rootfs/api/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
logger = logging.getLogger(__name__)
1818

1919

20-
class RegisterForm(UserCreationForm):
20+
class RegistrationForm(UserCreationForm):
2121
class Meta(UserCreationForm.Meta):
2222
model = User
2323
fields = ('username', 'email', 'password1', 'password2')

rootfs/api/settings/production.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
DEBUG_PROPAGATE_EXCEPTIONS = True
2323
# Enable Django admin
2424
ADMIN_ENABLED = bool(os.environ.get('ADMIN_ENABLED', False))
25-
# Enable Register
25+
# Enable Registration
2626
# If this function is enabled, please set Django email related parameters
27-
REGISTER_ENABLED = bool(os.environ.get('REGISTER_ENABLED', False))
27+
REGISTRATION_ENABLED = bool(os.environ.get('REGISTRATION_ENABLED', False))
2828
# Silence two security messages around SSL as router takes care of them
2929
# https://docs.djangoproject.com/en/2.2/ref/checks/#security
3030
SILENCED_SYSTEM_CHECKS = [
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends 'user/message.html' %}
22
{% block title %}Account activite fail{% endblock %}
33
{% block message %}
4-
The confirmation link was invalid, possibly it has already been used, go back <a href="/user/register/">register</a>
4+
The confirmation link was invalid, possibly it has already been used, go back <a href="/user/registration/">Sign Up</a>
55
{% endblock %}

rootfs/api/templates/user/login.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h2 class="h3">Log in to your account</h2>
2626
<button class="btn btn-primary btn-lg btn-block" name="commit" type="submit">Log In</button>
2727
<input type="hidden" name="next" value={{ next }}>
2828
</form>
29-
<a class="panel-footer" href="/user/register/"><span>Sign Up</span></a>
29+
<a class="panel-footer" href="/user/registration/"><span>Sign Up</span></a>
3030
</div>
3131
<a href="/user/password_reset/" class="white-link">Forgot your password?</a>
3232
</div>

rootfs/api/templates/user/register.html renamed to rootfs/api/templates/user/registration.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="page-wrap gradient-primary">
1111
<div class="container">
1212
<div class="panel">
13-
<h2 class="h3">Register</h2>
13+
<h2 class="h3">Registration</h2>
1414
<form method="post">
1515
{% csrf_token %}
1616
<div class="form-group">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends 'user/message.html' %}
2-
{% block title %}Register successful{% endblock %}
2+
{% block title %}Registration successful{% endblock %}
33
{% block message %}
44
We have sent an email to your mailbox, please log in the email to activate your account.
55
{% endblock %}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% extends 'user/message.html' %}
2-
{% block title %}Register fail{% endblock %}
2+
{% block title %}Registration fail{% endblock %}
33
{% block message %}
4-
The registration function of drycc passport is not enabled. Please contact the administrator to register.
4+
The registration function of drycc passport is not enabled. Please contact the administrator to sign up.
55
{% endblock %}

rootfs/api/urls.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from rest_framework.routers import DefaultRouter
44

55
from api import views
6-
from api.views import RegisterView, ActivateAccount, RegisterDoneView, \
6+
from api.views import RegistrationView, ActivateAccount, RegistrationDoneView, \
77
ActivateAccountDoneView, ActivateAccountFailView, LoginDoneView
88

99
router = DefaultRouter(trailing_slash=False)
@@ -12,11 +12,11 @@
1212
re_path(r'^', include(router.urls)),
1313
re_path(r'^info/?$',
1414
views.UserDetailView.as_view({'get': 'retrieve', 'put': 'update'})),
15-
re_path(r'register/?$', RegisterView.as_view(), name='register'),
15+
re_path(r'registration/?$', RegistrationView.as_view(), name='registration'),
1616
re_path(r'activate/(?P<uidb64>.+)/(?P<token>.+)/?$',
1717
ActivateAccount.as_view(), name='user_activate_account'),
18-
re_path(r'register/done/?$', RegisterDoneView.as_view(),
19-
name='user_register_done'),
18+
re_path(r'registration/done/?$', RegistrationDoneView.as_view(),
19+
name='user_registration_done'),
2020
re_path(r'activate/done/?$', ActivateAccountDoneView.as_view(),
2121
name='user_activate_account_done'),
2222
re_path(r'activate/fail/?$', ActivateAccountFailView.as_view(),

rootfs/api/views.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from api import serializers
2525
from api.exceptions import ServiceUnavailable, DryccException
26-
from api.serializers import RegisterForm
26+
from api.serializers import RegistrationForm
2727
from api.utils import account_activation_token, get_local_host
2828
from api.viewset import NormalUserViewSet
2929

@@ -60,19 +60,19 @@ def get(self, request):
6060
head = get
6161

6262

63-
class RegisterView(CreateView):
64-
form_class = RegisterForm
65-
template_name = 'user/register.html'
66-
success_url = reverse_lazy('register_done')
63+
class RegistrationView(CreateView):
64+
form_class = RegistrationForm
65+
template_name = 'user/registration.html'
66+
success_url = reverse_lazy('registration_done')
6767

6868
def get(self, request, *args, **kwargs):
69-
if settings.LDAP_ENDPOINT or not settings.REGISTER_ENABLED:
70-
return render(request, template_name='user/register_fail.html')
69+
if settings.LDAP_ENDPOINT or not settings.REGISTRATION_ENABLED:
70+
return render(request, template_name='user/registration_fail.html')
7171
return CreateView.get(self, request, *args, **kwargs)
7272

7373
def post(self, request, *args, **kwargs):
74-
if settings.LDAP_ENDPOINT or not settings.REGISTER_ENABLED:
75-
return render(request, template_name='user/register_fail.html')
74+
if settings.LDAP_ENDPOINT or not settings.REGISTRATION_ENABLED:
75+
return render(request, template_name='user/registration_fail.html')
7676
form = self.form_class(request.POST)
7777
self.object = None
7878
if form.is_valid():
@@ -97,8 +97,8 @@ def post(self, request, *args, **kwargs):
9797
return self.form_invalid(form)
9898

9999

100-
class RegisterDoneView(TemplateView):
101-
template_name = 'user/register_done.html'
100+
class RegistrationDoneView(TemplateView):
101+
template_name = 'user/registration_done.html'
102102
title = _('Activate email sent')
103103

104104

0 commit comments

Comments
 (0)