diff --git a/requirements.txt b/requirements.txt index af05bcded8..d43e8f2589 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,8 @@ python-dateutil chardet six Pillow>=2.6.1,<3.0.0 -Django>=1.5.8,<1.6 -Djblets==0.6.14 +Django==1.8.5 +Djblets==0.8.22 django-compressor==1.4 django-statici18n==1.1.2 git+git://github.com/haiwen/django-constance.git@bde7f7cdfd0ed1631a6817fd4cd76f37bf54fe35#egg=django-constance[database] diff --git a/seahub/api2/urls.py b/seahub/api2/urls.py index 12700e200c..2c09ca644d 100644 --- a/seahub/api2/urls.py +++ b/seahub/api2/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url, include from .views import * from .views_misc import ServerInfoView diff --git a/seahub/auth/models.py b/seahub/auth/models.py index 677604477d..62a70df553 100644 --- a/seahub/auth/models.py +++ b/seahub/auth/models.py @@ -50,8 +50,8 @@ class AnonymousUser(object): is_staff = False is_active = False is_superuser = False - _groups = EmptyManager() - _user_permissions = EmptyManager() + _groups = EmptyManager(object) + _user_permissions = EmptyManager(object) def __init__(self): pass diff --git a/seahub/avatar/urls.py b/seahub/avatar/urls.py index b652488084..dd418d8a8a 100644 --- a/seahub/avatar/urls.py +++ b/seahub/avatar/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns('seahub.avatar.views', url('^add/$', 'add', name='avatar_add'), diff --git a/seahub/base/context_processors.py b/seahub/base/context_processors.py index 9c62c54935..11480b42f0 100644 --- a/seahub/base/context_processors.py +++ b/seahub/base/context_processors.py @@ -13,7 +13,7 @@ from constance import config from seahub.settings import SEAFILE_VERSION, SITE_TITLE, SITE_NAME, \ MAX_FILE_NAME, BRANDING_CSS, LOGO_PATH, LOGO_WIDTH, LOGO_HEIGHT,\ - SHOW_REPO_DOWNLOAD_BUTTON + SHOW_REPO_DOWNLOAD_BUTTON, SITE_ROOT try: from seahub.settings import SEACLOUD_MODE @@ -86,4 +86,5 @@ def base(request): 'grps': grps, 'multi_tenancy': MULTI_TENANCY, 'search_repo_id': search_repo_id, + 'SITE_ROOT': SITE_ROOT, } diff --git a/seahub/base/registration_urls.py b/seahub/base/registration_urls.py index 0f31504806..cdc6d91c8b 100644 --- a/seahub/base/registration_urls.py +++ b/seahub/base/registration_urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url, include from django.views.generic import TemplateView from django.conf import settings diff --git a/seahub/contacts/models.py b/seahub/contacts/models.py index a875b1b7e6..bbfaecbb0e 100644 --- a/seahub/contacts/models.py +++ b/seahub/contacts/models.py @@ -70,6 +70,7 @@ class Contact(models.Model): class ContactAddForm(ModelForm): class Meta: model = Contact + fields = "__all__" def clean(self): if not 'contact_email' in self.cleaned_data: @@ -80,7 +81,8 @@ class ContactAddForm(ModelForm): class ContactEditForm(ModelForm): class Meta: model = Contact - + fields = "__all__" + def __init__(self, *args, **kwargs): super(ContactEditForm, self).__init__(*args, **kwargs) self.fields['contact_email'].widget.attrs['readonly'] = True diff --git a/seahub/contacts/urls.py b/seahub/contacts/urls.py index fd7181bc6b..04c58dd08f 100644 --- a/seahub/contacts/urls.py +++ b/seahub/contacts/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from views import * diff --git a/seahub/group/urls.py b/seahub/group/urls.py index 51682e7061..2104a908cd 100644 --- a/seahub/group/urls.py +++ b/seahub/group/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from views import group_info, group_members, group_member_operations, group_add_admin, \ group_manage, msg_reply, msg_reply_new, group_recommend, \ diff --git a/seahub/help/urls.py b/seahub/help/urls.py index 43e3a107fa..3cfcdfff6c 100644 --- a/seahub/help/urls.py +++ b/seahub/help/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url, include from django.views.generic import TemplateView urlpatterns = patterns( diff --git a/seahub/message/urls.py b/seahub/message/urls.py index d943b1572a..4692c83983 100644 --- a/seahub/message/urls.py +++ b/seahub/message/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from django.views.generic.base import RedirectView from views import message_list, message_send ,user_msg_list ,msg_count diff --git a/seahub/notifications/urls.py b/seahub/notifications/urls.py index 10b227812c..6bb778a126 100644 --- a/seahub/notifications/urls.py +++ b/seahub/notifications/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import patterns, url +from django.conf.urls import patterns, url urlpatterns = patterns('seahub.notifications.views', # url(r'^$', 'notification_list', name='notification_list'), diff --git a/seahub/options/urls.py b/seahub/options/urls.py index b759da97ac..3af2a492e5 100644 --- a/seahub/options/urls.py +++ b/seahub/options/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from views import * diff --git a/seahub/profile/urls.py b/seahub/profile/urls.py index dcc8ca356c..0ba3aee908 100644 --- a/seahub/profile/urls.py +++ b/seahub/profile/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url urlpatterns = patterns('seahub.profile.views', # url(r'^list_user/$', 'list_userids', name="list_userids"), diff --git a/seahub/settings.py b/seahub/settings.py index 67b22a1997..54291d4f06 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -121,7 +121,7 @@ MIDDLEWARE_CLASSES = ( ) SITE_ROOT_URLCONF = 'seahub.urls' -ROOT_URLCONF = 'djblets.util.rooturl' +ROOT_URLCONF = 'seahub.utils.rooturl' SITE_ROOT = '/' # Python dotted path to the WSGI application used by Django's runserver. @@ -176,7 +176,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.static', - 'djblets.util.context_processors.siteRoot', + # 'djblets.util.context_processors.siteRoot', 'django.core.context_processors.request', 'django.contrib.messages.context_processors.messages', 'seahub.base.context_processors.base', diff --git a/seahub/share/urls.py b/seahub/share/urls.py index ae3e95dd57..876c2e4593 100644 --- a/seahub/share/urls.py +++ b/seahub/share/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from views import * diff --git a/seahub/thumbnail/urls.py b/seahub/thumbnail/urls.py index 24b475273f..2bcc831b06 100644 --- a/seahub/thumbnail/urls.py +++ b/seahub/thumbnail/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url, include from views import thumbnail_create, thumbnail_get, share_link_thumbnail_get, \ share_link_thumbnail_create diff --git a/seahub/urls.py b/seahub/urls.py index 93606f1c37..b945bb7373 100644 --- a/seahub/urls.py +++ b/seahub/urls.py @@ -1,5 +1,5 @@ -from django.conf.urls.defaults import * from django.conf import settings +from django.conf.urls import patterns, url, include # from django.views.generic.simple import direct_to_template from django.views.generic import TemplateView diff --git a/seahub/utils/rooturl.py b/seahub/utils/rooturl.py new file mode 100644 index 0000000000..077ce47ebc --- /dev/null +++ b/seahub/utils/rooturl.py @@ -0,0 +1,41 @@ +# +# rooturl.py -- URL patterns for rooted sites. +# +# Copyright (c) 2007-2009 Christian Hammond +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + + +from django.conf import settings +from django.conf.urls import patterns, include +from django.core.exceptions import ImproperlyConfigured + + +# Ensures that we can run nose on this without needing to set SITE_ROOT. +# Also serves to let people know if they set one variable without the other. +if hasattr(settings, "SITE_ROOT"): + if not hasattr(settings, "SITE_ROOT_URLCONF"): + raise ImproperlyConfigured("SITE_ROOT_URLCONF must be set when " + "using SITE_ROOT") + + urlpatterns = patterns('', + (r'^%s' % settings.SITE_ROOT[1:], include(settings.SITE_ROOT_URLCONF)), + ) diff --git a/thirdpart/registration/auth_urls.py b/thirdpart/registration/auth_urls.py index 824ceb1e60..0888ea55b1 100644 --- a/thirdpart/registration/auth_urls.py +++ b/thirdpart/registration/auth_urls.py @@ -24,7 +24,7 @@ consult a specific backend's documentation for details. """ from django.conf import settings -from django.conf.urls.defaults import * +from django.conf.urls import patterns, url from seahub.auth import views as auth_views diff --git a/thirdpart/registration/models.py b/thirdpart/registration/models.py index 58c5fa02a2..f2013d40d0 100644 --- a/thirdpart/registration/models.py +++ b/thirdpart/registration/models.py @@ -6,7 +6,7 @@ import re from django.conf import settings from django.db import models -from django.db import transaction +# from django.db import transaction from django.template.loader import render_to_string from django.utils.translation import ugettext_lazy as _ @@ -91,14 +91,14 @@ class RegistrationManager(models.Manager): return self.create_email_user(username, email, password, site, send_email, is_active=False) - create_inactive_user = transaction.commit_on_success(create_inactive_user) + # create_inactive_user = transaction.commit_on_success(create_inactive_user) def create_active_user(self, username, email, password, site, send_email=True): return self.create_email_user(username, email, password, site, send_email, is_active=True) - create_inactive_user = transaction.commit_on_success(create_inactive_user) + # create_inactive_user = transaction.commit_on_success(create_inactive_user) def create_profile(self, user): """ diff --git a/thirdpart/rest_framework/parsers.py b/thirdpart/rest_framework/parsers.py index 4841676c9d..cebabb4b88 100644 --- a/thirdpart/rest_framework/parsers.py +++ b/thirdpart/rest_framework/parsers.py @@ -4,11 +4,11 @@ Parsers are used to parse the content of incoming HTTP requests. They give us a generic way of being able to handle various media types on the request, such as form content or json encoded data. """ +import json from django.http import QueryDict from django.http.multipartparser import MultiPartParser as DjangoMultiPartParser from django.http.multipartparser import MultiPartParserError -from django.utils import simplejson as json from rest_framework.compat import yaml, ETParseError from rest_framework.exceptions import ParseError from xml.etree import ElementTree as ET diff --git a/thirdpart/rest_framework/renderers.py b/thirdpart/rest_framework/renderers.py index 550963cb24..2a7ed4f2f5 100644 --- a/thirdpart/rest_framework/renderers.py +++ b/thirdpart/rest_framework/renderers.py @@ -8,10 +8,10 @@ REST framework also provides an HTML renderer the renders the browsable API. """ import copy import string +import json from django import forms from django.http.multipartparser import parse_header from django.template import RequestContext, loader, Template -from django.utils import simplejson as json from rest_framework.compat import yaml from rest_framework.exceptions import ConfigurationError from rest_framework.settings import api_settings diff --git a/thirdpart/rest_framework/utils/encoders.py b/thirdpart/rest_framework/utils/encoders.py index 2d1fb353e4..c9146286e7 100644 --- a/thirdpart/rest_framework/utils/encoders.py +++ b/thirdpart/rest_framework/utils/encoders.py @@ -4,7 +4,8 @@ Helper classes for parsers. import datetime import decimal import types -from django.utils import simplejson as json +import json + from django.utils.datastructures import SortedDict from rest_framework.compat import timezone from rest_framework.serializers import DictWithMetadata, SortedDictWithMetadata