diff --git a/OpenBench/views.py b/OpenBench/views.py
index eb22acd..588c57a 100644
--- a/OpenBench/views.py
+++ b/OpenBench/views.py
@@ -25,16 +25,23 @@ def register(request):
return render(request, 'register.html', {})
try:
+ # Verify that the passwords are matching
+ if request.POST['password1'] != request.POST['password2']:
+ raise Exception('Passwords Do Not Match')
+
+ # Force alpha numeric usernames
+ if not request.POST['username'].isalnum():
+ raise Exception('Alpha Numeric Usernames Only')
+
# Attempt to create and login the new user
user = User.objects.create_user(
request.POST['username'],
request.POST['email'],
- request.POST['password']
+ request.POST['password1']
)
- # Login the user and return to index
- user.save()
- loginUser(request, user)
+ # Save and log the user in
+ user.save(); loginUser(request, user)
# Wrap the User in a Profile
profile = Profile()
diff --git a/Templates/OpenBench/register.html b/Templates/OpenBench/register.html
index e9f85ab..704cc33 100644
--- a/Templates/OpenBench/register.html
+++ b/Templates/OpenBench/register.html
@@ -9,9 +9,11 @@
{% csrf_token %}
-
-
-
+
+
+
+
+
diff --git a/db.sqlite3 b/db.sqlite3
index 4d7c4a3..1cf65c8 100644
Binary files a/db.sqlite3 and b/db.sqlite3 differ