mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-21 22:28:57 +00:00
Removed 'send_email' from register
This commit is contained in:
parent
ec3eddffa3
commit
7bfad1a5cb
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ celerybeat-schedule
|
|||||||
databasepostgresql_env
|
databasepostgresql_env
|
||||||
SeriesRobot.pem
|
SeriesRobot.pem
|
||||||
certbot
|
certbot
|
||||||
|
imdb_api_access
|
@ -11,5 +11,4 @@ class RegisterForm(UserCreationForm):
|
|||||||
'email',
|
'email',
|
||||||
'password1',
|
'password1',
|
||||||
'password2',
|
'password2',
|
||||||
'imdb_api_key',
|
'imdb_api_key')
|
||||||
'send_email')
|
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
{{form.password1|as_crispy_field}} <br>
|
{{form.password1|as_crispy_field}} <br>
|
||||||
{{form.password2|as_crispy_field}} <br>
|
{{form.password2|as_crispy_field}} <br>
|
||||||
{{form.imdb_api_key|as_crispy_field}}
|
{{form.imdb_api_key|as_crispy_field}}
|
||||||
<a href="https://imdb-api.com/Identity/Account/Register">Get API Key</a> <br><br>
|
<a href="https://imdb-api.com/Identity/Account/Register">Get API Key</a> <br>
|
||||||
{{form.send_email|as_crispy_field}} <br>
|
|
||||||
<style>
|
<style>
|
||||||
.btn:hover {
|
.btn:hover {
|
||||||
background: #fff;
|
background: #fff;
|
||||||
|
@ -32,9 +32,6 @@ def register_view(request): # sourcery skip: extract-method
|
|||||||
return redirect('register')
|
return redirect('register')
|
||||||
|
|
||||||
to_email = form.cleaned_data.get('email')
|
to_email = form.cleaned_data.get('email')
|
||||||
if to_email is None and form.cleaned_data.get('send_email'):
|
|
||||||
form.add_error('send_email', 'Email field is required to receive email notifications.')
|
|
||||||
return render(request, 'register.html', context={"form": form})
|
|
||||||
|
|
||||||
form.save()
|
form.save()
|
||||||
username = form.cleaned_data.get('username')
|
username = form.cleaned_data.get('username')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user