Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create an album with Django 1.10 #73

Open
sveetch opened this issue Feb 14, 2018 · 0 comments
Open

Unable to create an album with Django 1.10 #73

sveetch opened this issue Feb 14, 2018 · 0 comments

Comments

@sveetch
Copy link

sveetch commented Feb 14, 2018

Hi,

I've tried to use imagestore with Django 1.10.8, from the Django admin i can create an Image object but trying to create a new Album object result in an exception:

Traceback (most recent call last):
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/exception.py", line 42, in inner
    response = get_response(request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 544, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 211, in inner
    return view(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1509, in add_view
    return self.changeform_view(request, None, form_url, extra_context)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/utils/decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1450, in changeform_view
    self.save_related(request, form, formsets, not add)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1031, in save_related
    self.save_formset(request, form, formset, change=change)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1019, in save_formset
    formset.save()
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 651, in save
    return self.save_existing_objects(commit) + self.save_new_objects(commit)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 784, in save_new_objects
    self.new_objects.append(self.save_new(form, commit=commit))
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/forms/models.py", line 928, in save_new
    obj.save()
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 796, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 824, in save_base
    updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
  File "/home/emencia/projects/transinter/.envs/default/lib/python3.5/site-packages/django/db/models/base.py", line 880, in _save_table
    raise ValueError("Cannot force an update in save() with no primary key.")
ValueError: Cannot force an update in save() with no primary key.

This is effective with imagestore 3.0.0 and 3.1.0. Version 2.9.1 result in another error i assumed to be related to Django>1.9 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant