PiRSquared17 / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

KeyError Value: 'en-us' #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add page (/pages/page/add/?language=en&)
2.
3.

What is the expected output? What do you see instead?
page added

What version of the product are you using? On what operating system?
svn version
linux/fedora

Please provide any additional information below.
Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/pages/page/add/
Django Version: 1.1 beta 1 SVN-10370
Python Version: 2.4.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'MontyPython.montypython',
 'contact_form',
 'tagging',
 'treemenus',
 'registration',
 'mptt',
 'pages']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.locale.LocaleMiddleware',
 'django.middleware.doc.XViewMiddleware')

Traceback:
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/core/handlers/base.
py"
in get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/contrib/admin/sites
.py"
in root
  459.                 return self.model_page(request, *url.split('/', 2))
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/views/decorators/ca
che.py"
in _wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/contrib/admin/sites
.py"
in model_page
  478.         return admin_obj(request, rest_of_url)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/extras/django-page-cms/pages/admi
n/__init__.py"
in __call__
  100.         return super(PageAdmin, self).__call__(request, url)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/contrib/admin/optio
ns.py"
in __call__
  1075.             return self.add_view(request)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/db/transaction.py"
in _commit_on_success
  240.                 res = func(*args, **kw)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/contrib/admin/optio
ns.py"
in add_view
  740.                 self.log_addition(request, new_object)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/contrib/admin/optio
ns.py"
in log_addition
  372.             object_repr     = force_unicode(object),
File
"/home/dijkstra/DjangoProjects/firsttest/parts/django/django/utils/encoding.py"
in force_unicode
  56.                 s = unicode(s)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/extras/django-page-cms/pages/mode
ls.py"
in __unicode__
  235.         slug = self.slug()
File
"/home/dijkstra/DjangoProjects/firsttest/parts/extras/django-page-cms/pages/mode
ls.py"
in slug
  164.                                            language_fallback=fallback)
File
"/home/dijkstra/DjangoProjects/firsttest/parts/extras/django-page-cms/pages/mana
gers.py"
in get_content
  143.         if content_dict[language]:

Exception Type: KeyError at /admin/pages/page/add/
Exception Value: 'en-us'

Original issue reported on code.google.com by dijkstra...@gmail.com on 3 Apr 2009 at 9:44

GoogleCodeExporter commented 9 years ago
I fixed it by changing the default language code to one of the languages set.

LANGUAGE_CODE = 'en'

instead of:

LANGUAGE_CODE = 'en_us'

the wiki page misses that.

Original comment by yoan.blanc on 5 Apr 2009 at 3:46

GoogleCodeExporter commented 9 years ago
You need to set LANGUAGE_CODE to a language you actually want to support within 
the CMS.

Original comment by batiste....@gmail.com on 6 Apr 2009 at 2:08

GoogleCodeExporter commented 9 years ago
I added some docs on languages if it can help:

http://code.google.com/p/django-page-cms/wiki/InstallDjangoPageCMS#Languages

Original comment by batiste....@gmail.com on 6 Apr 2009 at 2:56

GoogleCodeExporter commented 9 years ago
Since this is not reproductible, I close the bug.

Original comment by batiste....@gmail.com on 7 Jun 2009 at 2:20