formulario de registro

parent 03f19682
...@@ -651,8 +651,8 @@ def IPN(request): ...@@ -651,8 +651,8 @@ def IPN(request):
def Registration(request): def Registration(request):
#user = User.objects.filter(email=request.POST['email']) #user = User.objects.filter(email=request.POST['email'])
if User.objects.filter(email=request.POST['email']): if User.objects.filter(email=request.POST['email']):
print("ya existe") messages.warning(request, 'the username or password already exist')
return HttpResponse("el correo ya está registrado") return HttpResponse("the username or password already exist")
else: else:
print("agregado") print("agregado")
User.objects.create_user(username=request.POST['username'], User.objects.create_user(username=request.POST['username'],
...@@ -661,5 +661,5 @@ def Registration(request): ...@@ -661,5 +661,5 @@ def Registration(request):
message = "your registration is being processed" message = "your registration is being processed"
subject = "Registro RepSat" subject = "Registro RepSat"
wsMail2(request.POST['email'],request.POST['username'],message,subject) wsMail2(request.POST['email'],request.POST['username'],message,subject)
messages.info(request, 'your registration is being processed') messages.success(request, 'your registration is being processed')
return HttpResponseRedirect('login') return HttpResponseRedirect('login')
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
{% block headMedia %} {% block headMedia %}
<link rel="stylesheet" href="{% static 'catalog/css/login.css' %}" type="text/css"> <link rel="stylesheet" href="{% static 'catalog/css/login.css' %}" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
{% endblock %} {% endblock %}
{% block budy %} {% block budy %}
...@@ -126,7 +128,9 @@ ...@@ -126,7 +128,9 @@
<!-- /.col --> <!-- /.col -->
<div class="col-xs-12"> <div class="col-xs-12">
<button id="submit-button" type="submit" class="btn btn-primary btn-block btn-flat btnGeo">Register</button> <button id="submit-button" type="submit" class="btn btn-primary btn-block btn-flat btnGeo">
Register
</button>
</div> </div>
<!-- /.col --> <!-- /.col -->
</div> </div>
...@@ -152,9 +156,20 @@ ...@@ -152,9 +156,20 @@
</div> </div>
</div> </div>
{% if messages %}
<div class="container col-md-2 col-lg-2 col-xs-2 col-sm-2 pull-right">
{% for message in messages %}
<div {% if message.tags %} class="fade in alert alert-dismissible alert-{{ message.tags }}"{% endif %}>
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>{{ message.tags }}!</strong> {{ message }}.
</div>
{% endfor %}
</div>
{% endif %}
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script> <script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment