# HG changeset patch # User ymh # Date 1369430871 -7200 # Node ID 665f520f23ae51477b7bbbb5b6e842c6ff12e714 # Parent b94866be0f53b912cb09ca8092334b4735885faf# Parent daeaf144418250308f31b45aa970f1b42cf7d4c7 Merge with daeaf144418250308f31b45aa970f1b42cf7d4c7 diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/config.py.tmpl --- a/src/ldtplatform/config.py.tmpl Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/config.py.tmpl Fri May 24 23:27:51 2013 +0200 @@ -48,7 +48,6 @@ # PATH where uploaded media are put. STREAM_PATH = CONTENT_ROOT -ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/management/commands/loadandadddata.py --- a/src/ldtplatform/management/commands/loadandadddata.py Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/management/commands/loadandadddata.py Fri May 24 23:27:51 2013 +0200 @@ -9,10 +9,10 @@ from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from ldt.ldt_utils.models import Content, Project +from ldt.security.cache import cached_assign from optparse import make_option +import json import os.path -import json -from ldt.security.cache import cached_assign class Command(BaseCommand): @@ -70,9 +70,9 @@ # Check if temporary files already exist path = os.path.abspath(args[0]) - dir = os.path.dirname(path) - path_file1 = os.path.join(dir, 'temp_data1.json') - path_file2 = os.path.join(dir, 'temp_data2.json') + dirpath = os.path.dirname(path) + path_file1 = os.path.join(dirpath, 'temp_data1.json') + path_file2 = os.path.join(dirpath, 'temp_data2.json') do_import = True if os.path.exists(path_file1) or os.path.exists(path_file2): confirm = raw_input((""" @@ -80,7 +80,7 @@ Do you want to continue ? - Type 'y' to continue, or 'n' to quit: """) % dir) + Type 'y' to continue, or 'n' to quit: """) % dirpath) do_import = (confirm == "y") # Continue @@ -136,12 +136,12 @@ # It will enable to parse and replace easily the old pk by the new ones in the permission datas if m=="ldt_utils.project": pk = str(obj["pk"]) - id = obj["fields"]["ldt_id"] - project_pk_id[pk] = id + ldt_id = obj["fields"]["ldt_id"] + project_pk_id[pk] = ldt_id elif m=="ldt_utils.content": pk = str(obj["pk"]) - id = obj["fields"]["iri_id"] - content_pk_id[pk] = id + ldt_id = obj["fields"]["iri_id"] + content_pk_id[pk] = ldt_id obj["pk"] = None else: obj["pk"] = None @@ -184,9 +184,9 @@ ignored_content_pks = [] perm_data = [] for obj in data_file2: - type = obj["fields"]["content_type"][1] + content_type = obj["fields"]["content_type"][1] old_pk = obj["fields"]["object_pk"] - if type=="project": + if content_type =="project": try: obj["fields"]["object_pk"] = project_pk_id[old_pk] except: @@ -195,7 +195,7 @@ continue # Keeping only valuables objs avoids errors when we we get the new pks perm_data.append(obj) - elif type == "content": + elif content_type == "content": try: obj["fields"]["object_pk"] = content_pk_id[old_pk] except: @@ -237,11 +237,11 @@ # Now we reparse the perm_data and update with the new pks for obj in perm_data: - type = obj["fields"]["content_type"][1] + content_type = obj["fields"]["content_type"][1] obj_id = obj["fields"]["object_pk"] - if type=="project": + if content_type=="project": obj["fields"]["object_pk"] = project_id_pk[obj_id] - elif type == "content": + elif content_type == "content": obj["fields"]["object_pk"] = content_id_pk[obj_id] diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/migrations/0001_initial.py --- a/src/ldtplatform/migrations/0001_initial.py Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/migrations/0001_initial.py Fri May 24 23:27:51 2013 +0200 @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db from south.v2 import SchemaMigration -from django.db import models class Migration(SchemaMigration): diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/migrations/0002_iri_url_update.py --- a/src/ldtplatform/migrations/0002_iri_url_update.py Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/migrations/0002_iri_url_update.py Fri May 24 23:27:51 2013 +0200 @@ -1,9 +1,6 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db +from django.core.management import call_command from south.v2 import DataMigration -from django.db import models -from django.core.management import call_command class Migration(DataMigration): diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/migrations/0003_recalculate_contentstat.py --- a/src/ldtplatform/migrations/0003_recalculate_contentstat.py Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/migrations/0003_recalculate_contentstat.py Fri May 24 23:27:51 2013 +0200 @@ -1,9 +1,6 @@ # -*- coding: utf-8 -*- -import datetime -from south.db import db +from django.core.management import call_command from south.v2 import DataMigration -from django.db import models -from django.core.management import call_command class Migration(DataMigration): diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/modwsgi.wsgi --- a/src/ldtplatform/modwsgi.wsgi Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/modwsgi.wsgi Fri May 24 23:27:51 2013 +0200 @@ -5,7 +5,7 @@ global g_env_set if 'g_env_set' not in globals() or not g_env_set: - os.environ['DJANGO_SETTINGS_MODULE'] = environ['DJANGO_SETTINGS_MODULE'] + os.environ.setdefault('DJANGO_SETTINGS_MODULE',environ['DJANGO_SETTINGS_MODULE']) prev_sys_path = list(sys.path) @@ -30,6 +30,5 @@ import pydevd #@UnresolvedImport pydevd.settrace(suspend=False) - return _application(environ, start_response) diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/settings.py --- a/src/ldtplatform/settings.py Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/settings.py Fri May 24 23:27:51 2013 +0200 @@ -65,7 +65,6 @@ # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a # trailing slash. # Examples: "http://foo.com/media/", "/media/". -#ADMIN_MEDIA_PREFIX = '/media/' #LDT_MEDIA_PREFIX = '/ldt/' @@ -130,28 +129,31 @@ 'django.contrib.admin', 'django.contrib.staticfiles', 'haystack', - 'ldtplatform', - 'registration', + 'tastypie', + 'guardian', 'tagging', - 'ldt', - 'ldt.core', - 'ldt.ldt_utils', - 'ldt.text', - 'ldt.user', - 'ldt.management', - 'ldt.indexation', + 'registration', 'oauth_provider', 'django_openid_consumer', 'social_auth', 'south', - 'guardian', 'sorl.thumbnail', - 'tastypie', + 'ldt', + 'ldt.core', + 'ldt.security', + 'ldt.user', + 'ldt.ldt_utils', + 'ldt.text', + 'ldt.management', + 'ldt.indexation', 'hashcut', 'chunked_uploads', + 'ldtplatform', ) -AUTH_PROFILE_MODULE = 'user.UserProfile' +#AUTH_PROFILE_MODULE = 'user.UserProfile' +AUTH_USER_MODEL = 'user.LdtUser' +INITIAL_CUSTOM_USER_MIGRATION = "0009_rename_auth_user_to_user_ldt_user" DECOUPAGE_BLACKLIST = ( "de_PPP", @@ -175,9 +177,9 @@ 'django.contrib.auth.backends.ModelBackend', 'guardian.backends.ObjectPermissionBackend', ) -SOCIAL_AUTH_IMPORT_BACKENDS = ( - 'myproy.social_auth_extra_services', -) +#SOCIAL_AUTH_IMPORT_BACKENDS = ( +# 'myproy.social_auth_extra_services', +#) ACCOUNT_ACTIVATION_DAYS = 7 @@ -266,11 +268,6 @@ if not "LOGIN_ERROR_URL" in locals(): LOGIN_ERROR_URL = SRC_BASE_URL + 'accounts/login' -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -if not "ADMIN_MEDIA_PREFIX" in locals(): - ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' # Used in a lot of templates if not "LDT_MEDIA_PREFIX" in locals(): LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' @@ -281,5 +278,6 @@ #forced settings MAX_TAG_LENGTH = 255 FORCE_LOWERCASE_TAGS = True + diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/templates/admin/base_site.html --- a/src/ldtplatform/templates/admin/base_site.html Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/templates/admin/base_site.html Fri May 24 23:27:51 2013 +0200 @@ -16,6 +16,6 @@ } - Admin home - Website home + Admin home + Website home {% endblock %} \ No newline at end of file diff -r b94866be0f53 -r 665f520f23ae src/ldtplatform/templates/registration/login.html --- a/src/ldtplatform/templates/registration/login.html Wed May 15 12:24:12 2013 +0200 +++ b/src/ldtplatform/templates/registration/login.html Fri May 24 23:27:51 2013 +0200 @@ -1,12 +1,11 @@ {% extends "registration/base.html" %} {% load i18n %} -{% load absstatic %} {% load static %} {% block css_import %} {{ block.super }} - - + + {% endblock %} {% block login %} @@ -26,7 +25,7 @@ {{form.as_ul}}
@@ -40,7 +39,7 @@