vittoriozamboni / django-groups-manager

Manage django groups collection based on django-mptt.
MIT License
100 stars 23 forks source link

ValueError: "<Group: Compravo>" needs to have a value for field "id" before this many-to-many relationship can be used. #26

Closed Allan-Nava closed 5 years ago

Allan-Nava commented 6 years ago

How can I fix?

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
    response = self._get_response(request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/ies/bootcamp/bootcamp/authentication/views.py", line 422, in create_society
    fsociety = Group(**form.cleaned_data)
  File "/usr/local/lib/python3.5/dist-packages/mptt/models.py", line 388, in __init__
    super(MPTTModel, self).__init__(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/base.py", line 567, in __init__
    _setattr(self, prop, kwargs[prop])
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/related_descriptors.py", line 536, in __set__
    manager = self.__get__(instance)
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/related_descriptors.py", line 513, in __get__
    return self.related_manager_cls(instance)
  File "/usr/local/lib/python3.5/dist-packages/django/db/models/fields/related_descriptors.py", line 830, in __init__
    (instance, self.pk_field_names[self.source_field_name]))
ValueError: "<Group: Compravo>" needs to have a value for field "id" before this many-to-many relationship can be used.
vittoriozamboni commented 5 years ago

Hi @Allan-Nava , how did you produced this error? Is still an issue? Really sorry for the late reply.

vittoriozamboni commented 5 years ago

Closing the issue.