# HG changeset patch # User ymh # Date 1369065757 -7200 # Node ID b6e0b181172309b2c128637ddbb84911b506e8b6 # Parent 129d45eec68ce67b9644ae929f244bf3223ff80a Migrate to django 1.5 : - migrate the user profile - do sme cleaning diff -r 129d45eec68c -r b6e0b1811723 .settings/org.eclipse.core.resources.prefs --- a/.settings/org.eclipse.core.resources.prefs Wed May 15 10:05:17 2013 +0200 +++ b/.settings/org.eclipse.core.resources.prefs Mon May 20 18:02:37 2013 +0200 @@ -35,6 +35,7 @@ encoding//src/ldt/ldt/ldt_utils/migrations/0024_auto__chg_field_tag_name.py=utf-8 encoding//src/ldt/ldt/ldt_utils/migrations/0025_chg_site_domain.py=utf-8 encoding//src/ldt/ldt/ldt_utils/migrations/0026_set_relative_ldtproject.py=utf-8 +encoding//src/ldt/ldt/ldt_utils/migrations/0027_auto__chg_field_project_owner__chg_field_media_creator.py=utf-8 encoding//src/ldt/ldt/ldt_utils/views/json.py=utf-8 encoding//src/ldt/ldt/management/commands/synciri.py=utf-8 encoding//src/ldt/ldt/management/commands/updateiriurlinprojects.py=utf-8 @@ -43,6 +44,12 @@ encoding//src/ldt/ldt/text/migrations/0001_initial.py=utf-8 encoding//src/ldt/ldt/text/migrations/0002_auto__chg_field_annotation_external_id.py=utf-8 encoding//src/ldt/ldt/user/migrations/0001_initial.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0005_add_permission_owner_group.py=utf-8 encoding//src/ldt/ldt/user/migrations/0008_auto__chg_field_groupprofile_image__chg_field_groupprofile_group__chg_.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0009_rename_auth_user_to_user_ldt_user.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0010_auto__add_field_ldtuser_language__add_field_ldtuser_image.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0011_copy_image_language_ldt_user.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0012_auto__del_userprofile.py=utf-8 +encoding//src/ldt/ldt/user/migrations/0013_auto__del_ldt.py=utf-8 encoding//virtualenv/web/env/guardianenv/Lib/site-packages/guardian/migrations/0001_initial.py=utf-8 encoding/=UTF-8 diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/api/ldt/resources/user.py --- a/src/ldt/ldt/api/ldt/resources/user.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/api/ldt/resources/user.py Mon May 20 18:02:37 2013 +0200 @@ -1,7 +1,9 @@ -from django.contrib.auth.models import User from django.conf.urls.defaults import url +from django.contrib.auth import get_user_model from tastypie.resources import Bundle, ModelResource +User = get_user_model() + class UserResource(ModelResource): class Meta: allowed_methods = ['get'] diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/auth/__init__.py --- a/src/ldt/ldt/auth/__init__.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/auth/__init__.py Mon May 20 18:02:37 2013 +0200 @@ -1,3 +1,6 @@ +from django.conf import settings +from social_auth.backends import get_backends + def check_access(user, obj): check_meth = getattr(obj, 'check_access', False) @@ -5,3 +8,13 @@ return check_meth(user) else: return user.is_staff + +def social_list(): + """Start list process""" + l = [] + # We list all wanted backends among all availables + for backend in get_backends(): + for backend_str in settings.AUTHENTICATION_BACKENDS: + if backend in backend_str: + l.append(backend) + return l \ No newline at end of file diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/auth/views.py --- a/src/ldt/ldt/auth/views.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/auth/views.py Mon May 20 18:02:37 2013 +0200 @@ -1,8 +1,7 @@ from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.views import login as django_login -from social_auth.views import list as social_list - +from ldt.auth import social_list def login(request, template_name='registration/login.html', redirect_field_name=REDIRECT_FIELD_NAME, diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/core/models.py --- a/src/ldt/ldt/core/models.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/core/models.py Mon May 20 18:02:37 2013 +0200 @@ -1,9 +1,8 @@ -from django.contrib.auth.models import User from django.db import models - +from django.conf import settings class Document(models.Model): - owner = models.ForeignKey(User, blank=True, null=True) + owner = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True) class Meta: abstract = True diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/indexation/__init__.py --- a/src/ldt/ldt/indexation/__init__.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/indexation/__init__.py Mon May 20 18:02:37 2013 +0200 @@ -5,8 +5,6 @@ from haystack.query import SearchQuerySet from ldt.indexation.highlighter import LdtHighlighter as Highlighter from ldt.indexation.query_parser import QueryParser -from ldt.ldt_utils.models import Segment -from ldt.text.models import Annotation import re import sys @@ -33,6 +31,9 @@ def get_results_list(field, query, highlight=True): + #put import here to avoid a circular dependency + from ldt.ldt_utils.models import Segment + if field == 'all': field = 'text' @@ -47,6 +48,9 @@ def get_result_text(field, query): + #put import here to avoid a circular dependency + from ldt.text.models import Annotation + if field == 'all': field = 'text' elif field == 'text': diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/indexation/backends/elasticsearch_backend.py --- a/src/ldt/ldt/indexation/backends/elasticsearch_backend.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/indexation/backends/elasticsearch_backend.py Mon May 20 18:02:37 2013 +0200 @@ -7,7 +7,7 @@ from haystack.backends import BaseEngine, elasticsearch_backend from haystack.exceptions import MissingDependency from haystack.utils import get_identifier -from ldt.ldt_utils.models import Segment +#from ldt.ldt_utils.models import Segment import collections try: import requests @@ -43,7 +43,7 @@ if highlight: fields_def = { } - if models is None or len(models) == 0 or Segment in models: + if models is None or len(models) == 0 :#or Segment in models: fields_def['tags'] = {} fields_def['title'] = {} fields_def['abstract'] = {} diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/indexation/signals.py --- a/src/ldt/ldt/indexation/signals.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/indexation/signals.py Mon May 20 18:02:37 2013 +0200 @@ -6,8 +6,6 @@ ''' from django.db import models from haystack import signals -from ldt.ldt_utils.models import Segment -from ldt.text.models import Annotation class LdtSignalProcessor(signals.BaseSignalProcessor): @@ -20,13 +18,20 @@ models.signals.post_delete.disconnect(self.handle_delete, sender=klass) - def setup(self): + def setup(self): + #put import here to avoid circular + from ldt.ldt_utils.models import Segment + from ldt.text.models import Annotation + self.__connect_signals(Segment) self.__connect_signals(Annotation) def teardown(self): + from ldt.ldt_utils.models import Segment + from ldt.text.models import Annotation + self.__disconnect_signals(Annotation) self.__disconnect_signals(Segment) \ No newline at end of file diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/ldt_utils/middleware/userprofile.py --- a/src/ldt/ldt/ldt_utils/middleware/userprofile.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/ldt_utils/middleware/userprofile.py Mon May 20 18:02:37 2013 +0200 @@ -6,8 +6,7 @@ def process_request(self, request): if request.user.is_authenticated(): - profile = request.user.get_profile() - language = profile.language + language = request.user.language else: language = settings.LANGUAGE_CODE[:2] request.user.is_regular = False diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/ldt_utils/migrations/0027_auto__chg_field_project_owner__chg_field_media_creator.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ldt/ldt/ldt_utils/migrations/0027_auto__chg_field_project_owner__chg_field_media_creator.py Mon May 20 18:02:37 2013 +0200 @@ -0,0 +1,160 @@ +# -*- coding: utf-8 -*- +from south.db import db +from south.v2 import SchemaMigration + + +class Migration(SchemaMigration): + + depends_on = ( + ("user", "0009_rename_auth_user_to_user_ldt_user"), + ) + + def forwards(self, orm): + + # Changing field 'Project.owner' + db.alter_column(u'ldt_utils_project', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['user.LdtUser'], null=True)) # @UndefinedVariable + + # Changing field 'Media.creator' + db.alter_column(u'ldt_utils_media', 'creator_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['user.LdtUser'], null=True)) # @UndefinedVariable + + def backwards(self, orm): + + # Changing field 'Project.owner' + db.alter_column(u'ldt_utils_project', 'owner_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) # @UndefinedVariable + + # Changing field 'Media.creator' + db.alter_column(u'ldt_utils_media', 'creator_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True)) # @UndefinedVariable + + models = { + u'auth.group': { + 'Meta': {'object_name': 'Group'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + u'auth.permission': { + 'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + u'contenttypes.contenttype': { + 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + u'ldt_utils.author': { + 'Meta': {'object_name': 'Author'}, + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), + 'firstname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'handle': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'lastname': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}) + }, + u'ldt_utils.content': { + 'Meta': {'ordering': "['title']", 'object_name': 'Content'}, + 'authors': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ldt_utils.Author']", 'symmetrical': 'False', 'blank': 'True'}), + 'content_creation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'front_project': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ldt_utils.Project']", 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "'thumbnails/contents/content_default_icon.png'", 'max_length': '200'}), + 'iri_id': ('django.db.models.fields.CharField', [], {'default': "u'ed941038-be29-11e2-8b76-58b035f6b93d'", 'unique': 'True', 'max_length': '255'}), + 'iriurl': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'media_obj': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ldt_utils.Media']", 'null': 'True', 'blank': 'True'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '2048', 'null': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'update_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}) + }, + u'ldt_utils.contentstat': { + 'Meta': {'object_name': 'ContentStat'}, + 'annotation_volume_str': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'stat_annotation'", 'unique': 'True', 'to': u"orm['ldt_utils.Content']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_annotated': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'null': 'True', 'blank': 'True'}), + 'nb_annotations': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}), + 'polemics_volume_str': ('django.db.models.fields.CommaSeparatedIntegerField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + u'ldt_utils.media': { + 'Meta': {'object_name': 'Media'}, + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'creator': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['user.LdtUser']", 'null': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_permalink': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_publication_url': ('django.db.models.fields.URLField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'external_src_url': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'media_creation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'mimetype_field': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'src': ('django.db.models.fields.CharField', [], {'max_length': '1024'}), + 'src_hash': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'update_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'videopath': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}) + }, + u'ldt_utils.project': { + 'Meta': {'ordering': "['title']", 'object_name': 'Project'}, + 'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), + 'contents': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['ldt_utils.Content']", 'symmetrical': 'False'}), + 'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}), + 'creation_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "'thumbnails/projects/project_default_icon.png'", 'max_length': '200'}), + 'ldt': ('django.db.models.fields.TextField', [], {'null': 'True'}), + 'ldt_id': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}), + 'modification_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['user.LdtUser']", 'null': 'True', 'blank': 'True'}), + 'state': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '1024'}) + }, + u'ldt_utils.segment': { + 'Meta': {'object_name': 'Segment'}, + 'abstract': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'audio_href': ('django.db.models.fields.CharField', [], {'max_length': '512', 'null': 'True', 'blank': 'True'}), + 'audio_src': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'author': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'null': 'True', 'blank': 'True'}), + 'content': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ldt_utils.Content']"}), + 'cutting_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'date': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'duration': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'element_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + 'ensemble_id': ('django.db.models.fields.CharField', [], {'max_length': '512', 'db_index': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'id_hash': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'blank': 'True'}), + 'iri_id': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}), + 'polemics': ('django.db.models.fields.IntegerField', [], {'default': '0', 'null': 'True', 'blank': 'True'}), + 'project_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '255', 'null': 'True', 'blank': 'True'}), + 'project_obj': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['ldt_utils.Project']", 'null': 'True'}), + 'start_ts': ('django.db.models.fields.IntegerField', [], {'null': 'True'}), + 'tags': ('tagging.fields.TagField', [], {'max_length': '2048', 'null': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '2048', 'null': 'True', 'blank': 'True'}) + }, + u'user.ldtuser': { + 'Meta': {'object_name': 'LdtUser'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('sorl.thumbnail.fields.ImageField', [], {'default': "'thumbnails/users/user_default_icon.png'", 'max_length': '200'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'language': ('django.db.models.fields.CharField', [], {'default': "'fr'", 'max_length': '2'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + } + } + + complete_apps = ['ldt_utils'] \ No newline at end of file diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/ldt_utils/models.py --- a/src/ldt/ldt/ldt_utils/models.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/ldt_utils/models.py Mon May 20 18:02:37 2013 +0200 @@ -1,5 +1,8 @@ +from .events import post_project_save from django.conf import settings -from django.contrib.auth.models import User, Group +from django.contrib.auth import get_user_model +from django.contrib.auth.models import Group +from django.core.files.storage import default_storage from django.db import models from django.utils.translation import ugettext_lazy as _ from guardian.shortcuts import assign, remove_perm, get_perms @@ -8,13 +11,13 @@ get_current_user) from ldt.security.manager import SafeManager from ldt.security.models import SafeModel -from ldt.utils import url as url_utils +from ldt.utils import generate_hash, url as url_utils +from ldt.utils.web_url_management import get_web_url +from shutil import move from sorl.thumbnail import ImageField from tagging.models import Tag from utils import (create_ldt, copy_ldt, create_empty_iri, update_iri, generate_uuid) -from ldt.utils import generate_hash -from ldt.utils.web_url_management import get_web_url import datetime import lxml.etree #@UnresolvedImport import mimetypes @@ -22,10 +25,8 @@ import re import tagging.fields import uuid -from shutil import move -from django.core.files.storage import default_storage -from .events import post_project_save +User = get_user_model() class Author(SafeModel): @@ -63,7 +64,7 @@ update_date = models.DateTimeField(auto_now=True, verbose_name=_('media.update_date')) videopath = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('media.videopath')) duration = models.IntegerField(null=True, blank=True, verbose_name=_('media.duration')) - creator = models.ForeignKey(User, blank=True, null=True, verbose_name=_('media.creator')) + creator = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, verbose_name=_('media.creator')) description = models.TextField(null=True, blank=True, verbose_name=_('description')) title = models.CharField(max_length=1024, null=True, blank=True, verbose_name=_('title')) src = models.CharField(max_length=1024, verbose_name=_('media.src')) diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/ldt_utils/projectserializer.py --- a/src/ldt/ldt/ldt_utils/projectserializer.py Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/ldt_utils/projectserializer.py Mon May 20 18:02:37 2013 +0200 @@ -1,14 +1,17 @@ from datetime import datetime from django.conf import settings +from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType from django.utils.datastructures import SortedDict -from ldt.ldt_utils.models import Content, User, Project +from ldt.ldt_utils.models import Content, Project from ldt.ldt_utils.stat import get_string_from_buckets from ldt.ldt_utils.utils import reduce_text_node import logging import lxml.etree import uuid +User = get_user_model() + DATE_FORMATS = ["%d/%m/%Y", "%Y-%m-%d"] logger = logging.getLogger(__name__) diff -r 129d45eec68c -r b6e0b1811723 src/ldt/ldt/ldt_utils/templates/front/front_group.html --- a/src/ldt/ldt/ldt_utils/templates/front/front_group.html Wed May 15 10:05:17 2013 +0200 +++ b/src/ldt/ldt/ldt_utils/templates/front/front_group.html Mon May 20 18:02:37 2013 +0200 @@ -118,7 +118,7 @@