formulario de registro

parent 03f19682
......@@ -651,8 +651,8 @@ def IPN(request):
def Registration(request):
#user = User.objects.filter(email=request.POST['email'])
if User.objects.filter(email=request.POST['email']):
print("ya existe")
return HttpResponse("el correo ya está registrado")
messages.warning(request, 'the username or password already exist')
return HttpResponse("the username or password already exist")
else:
print("agregado")
User.objects.create_user(username=request.POST['username'],
......@@ -661,5 +661,5 @@ def Registration(request):
message = "your registration is being processed"
subject = "Registro RepSat"
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')
......@@ -4,6 +4,8 @@
{% block headMedia %}
<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.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
{% endblock %}
{% block budy %}
......@@ -126,7 +128,9 @@
<!-- /.col -->
<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>
<!-- /.col -->
</div>
......@@ -152,9 +156,20 @@
</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 %}
{% block scripts %}
<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