diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py
index 795db80d..8c6d78b6 100644
--- a/PyRIGS/settings.py
+++ b/PyRIGS/settings.py
@@ -23,7 +23,7 @@ DEBUG = True
TEMPLATE_DEBUG = True
-ALLOWED_HOSTS = []
+ALLOWED_HOSTS = ['*']
INTERNAL_IPS = ['127.0.0.1', '10.20.30.20']
@@ -143,4 +143,6 @@ TEMPLATE_DIRS = (
os.path.join(BASE_DIR, 'templates'),
)
+USE_GRAVATAR=True
+
TERMS_OF_HIRE_URL = "http://dev.nottinghamtec.co.uk/wp-content/uploads/2014/11/terms.pdf"
diff --git a/RIGS/templates/RIGS/profile_detail.html b/RIGS/templates/RIGS/profile_detail.html
index f21251b3..a9d9bbaf 100644
--- a/RIGS/templates/RIGS/profile_detail.html
+++ b/RIGS/templates/RIGS/profile_detail.html
@@ -4,8 +4,19 @@
{% block content %}
-
+
{{object.name}}
+
+ {% if object.pk == user.pk %}
+
+ {% endif %}
+
- First Name
- {{object.first_name}}
@@ -29,7 +40,7 @@
- {{object.phone}}
-
+
diff --git a/RIGS/urls.py b/RIGS/urls.py
index dd095bbe..27c932f9 100644
--- a/RIGS/urls.py
+++ b/RIGS/urls.py
@@ -111,7 +111,8 @@ urlpatterns = patterns('',
url(r'^user/(?P
\d+)/$',
permission_required_with_403('RIGS.view_profile')(views.ProfileDetail.as_view()),
name='profile_detail'),
- # url(r'^user/edit/')
+ url(r'^user/edit/$', login_required(views.ProfileUpdateSelf.as_view()),
+ name='profile_update_self'),
# API
url(r'^api/(?P\w+)/$', (views.SecureAPIRequest.as_view()), name="api_secure"),
diff --git a/RIGS/views.py b/RIGS/views.py
index dfb68d69..151a4117 100644
--- a/RIGS/views.py
+++ b/RIGS/views.py
@@ -9,7 +9,7 @@ from django.core import serializers
import simplejson
from django.contrib import messages
-from RIGS import models
+from RIGS import models, forms
"""
Displays the current rig count along with a few other bits and pieces
@@ -261,4 +261,18 @@ class ProfileDetail(generic.DetailView):
pk = self.request.user.id
self.kwargs['pk'] = pk
- return self.model.objects.filter(pk=pk)
\ No newline at end of file
+ return self.model.objects.filter(pk=pk)
+
+class ProfileUpdateSelf(generic.UpdateView):
+ model = models.Profile
+ fields = ['first_name', 'last_name', 'email', 'initials', 'phone']
+
+ def get_queryset(self):
+ pk = self.request.user.id
+ self.kwargs['pk'] = pk
+
+ return self.model.objects.filter(pk=pk)
+
+ def get_success_url(self):
+ url = reverse_lazy('profile_detail')
+ return url
\ No newline at end of file