Removed 'send_email' from register

This commit is contained in:
ayxan 2022-12-11 01:49:29 +04:00
parent ec3eddffa3
commit 7bfad1a5cb
4 changed files with 3 additions and 7 deletions

1
.gitignore vendored
View File

@ -9,3 +9,4 @@ celerybeat-schedule
databasepostgresql_env databasepostgresql_env
SeriesRobot.pem SeriesRobot.pem
certbot certbot
imdb_api_access

View File

@ -11,5 +11,4 @@ class RegisterForm(UserCreationForm):
'email', 'email',
'password1', 'password1',
'password2', 'password2',
'imdb_api_key', 'imdb_api_key')
'send_email')

View File

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

View File

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