From 1d9014ce973232687314a33345e475990ed2a79f Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 17:03:27 +0100 Subject: [PATCH 01/13] Updated requirements --- requirements.txt | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3a90e9d6..f77cb666 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,32 +1,31 @@ -Django==1.7.1 -Pillow==2.7.0 -PyMySQL==0.6.2 -PyPDF2==1.23 -Pygments==2.0.2 dj-database-url==0.3.0 dj-static==0.0.6 -django-debug-toolbar==1.2.2 +Django==1.8.2 +django-debug-toolbar==1.3.0 django-ical==1.3 django-recaptcha==1.0.4 -django-registration-redux==1.1 -django-reversion==1.8.5 +django-registration-redux==1.2 +django-reversion==1.8.7 django-toolbelt==0.0.1 gunicorn==19.3.0 icalendar==3.9.0 -lxml==3.4.1 +lxml==3.4.4 +Pillow==2.8.1 psycopg2==2.6 +Pygments==2.0.2 +PyMySQL==0.6.6 +PyPDF2==1.24 python-dateutil==2.4.2 -pytz==2015.2 -reportlab==2.7 +pytz==2015.4 +reportlab==3.1.44 selenium==2.45.0 -simplejson==3.6.5 +simplejson==3.7.2 six==1.9.0 -sqlparse==0.1.13 -static3==0.5.1 +sqlparse==0.1.15 +static3==0.6.1 svg2rlg==0.3 -wsgiref==0.1.2 yolk==0.4.3 -z3c.rml==2.7.2 +z3c.rml==2.8.1 zope.event==4.0.3 zope.interface==4.1.2 zope.schema==4.4.2 From ec0d959f73e7b29136ba89a06dce811ef2819df1 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 19:32:05 +0100 Subject: [PATCH 02/13] Remove legacy database --- PyRIGS/settings.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 9b8c0546..e6c77749 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -79,13 +79,6 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - }, - 'legacy': { - 'ENGINE': 'django.db.backends.mysql', - 'HOST': 'alfie.codedinternet.com', - 'NAME': 'tec_rigs', - 'USER': 'tec_rigs', - 'PASSWORD': 'xMNb(b+Giu]&', } } From f55adc0c4003706a9bf81ca93e87978156de59d2 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 19:36:30 +0100 Subject: [PATCH 03/13] Removed unnecessary select_related --- RIGS/versioning.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/versioning.py b/RIGS/versioning.py index f94fc9db..1065aa3c 100644 --- a/RIGS/versioning.py +++ b/RIGS/versioning.py @@ -102,7 +102,7 @@ def get_versions_for_model(models): versions = reversion.models.Version.objects.filter( content_type__in = content_types, - ).select_related("revision","revision.version_set").order_by("-pk") + ).select_related("revision").order_by("-pk") return versions From ad4784ff15500011725bc0852e4f43f25abfc562 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 19:42:05 +0100 Subject: [PATCH 04/13] Explicitly set redirect view permanent/temporary --- RIGS/rigboard.py | 1 + RIGS/urls.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 3fe891fe..9a06abe1 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -126,6 +126,7 @@ class EventPrint(generic.View): class EventDuplicate(generic.RedirectView): + permanent = False; def get_redirect_url(self, *args, **kwargs): new = get_object_or_404(models.Event, pk=kwargs['pk']) new.pk = None diff --git a/RIGS/urls.py b/RIGS/urls.py index 63d9fb95..c39a571c 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -69,7 +69,7 @@ urlpatterns = patterns('', # Rigboard url(r'^rigboard/$', login_required(rigboard.RigboardIndex.as_view()), name='rigboard'), url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'), - url(r'^rigboard/archive/$', RedirectView.as_view(pattern_name='event_archive')), + url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True,pattern_name='event_archive')), url(r'^rigboard/activity/$', permission_required_with_403('RIGS.view_event')(versioning.ActivityTable.as_view()), name='activity_table'), @@ -149,8 +149,8 @@ urlpatterns = patterns('', url(r'^api/(?P\w+)/(?P\d+)/$', (views.SecureAPIRequest.as_view()), name="api_secure"), # Legacy URL's - url(r'^rig/show/(?P\d+)/$', RedirectView.as_view(pattern_name='event_detail')), - url(r'^bookings/$', RedirectView.as_view(pattern_name='rigboard')), - url(r'^bookings/past/$', RedirectView.as_view(pattern_name='event_archive')), + url(r'^rig/show/(?P\d+)/$', RedirectView.as_view(permanent=True,pattern_name='event_detail')), + url(r'^bookings/$', RedirectView.as_view(permanent=True,pattern_name='rigboard')), + url(r'^bookings/past/$', RedirectView.as_view(permanent=True,pattern_name='event_archive')), ) From 284604e4a4bd7bd56d143c4cce79748efb496fee Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 19:48:20 +0100 Subject: [PATCH 05/13] Explicitly imported django.contrib.sites --- PyRIGS/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index e6c77749..e9bcc5f2 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -43,6 +43,7 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'django.contrib.sites', 'RIGS', 'debug_toolbar', From cbe49fc9dd8bcc17fd3a9f758c6dcbeafc09d75c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 20:00:46 +0100 Subject: [PATCH 06/13] Scrap that - bad idea! --- PyRIGS/settings.py | 1 - 1 file changed, 1 deletion(-) diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index e9bcc5f2..e6c77749 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -43,7 +43,6 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'django.contrib.sites', 'RIGS', 'debug_toolbar', From f78ce621d5771683f8fb67d202475c1aa3a31d8c Mon Sep 17 00:00:00 2001 From: David Taylor Date: Thu, 28 May 2015 20:07:45 +0100 Subject: [PATCH 07/13] Removed "from future" for url imports --- templates/base.html | 2 +- templates/registration/activation_email.txt | 2 +- templates/registration/loginform.html | 2 +- templates/registration/password_change_done.html | 2 +- templates/registration/password_change_form.html | 2 +- templates/registration/password_reset_complete.html | 2 +- templates/registration/password_reset_confirm.html | 2 +- templates/registration/password_reset_done.html | 2 +- templates/registration/password_reset_email.html | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/templates/base.html b/templates/base.html index 844d6fe6..297f1304 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,5 @@ {% load static from staticfiles %} -{% load url from future %} +{% load url %} diff --git a/templates/registration/password_change_done.html b/templates/registration/password_change_done.html index de778b2e..b7daccdc 100644 --- a/templates/registration/password_change_done.html +++ b/templates/registration/password_change_done.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% load i18n %} -{% load url from future %} +{% load url %} {% block breadcrumbs %}