You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REMOTE_ADDR is always 127.0.0.1 and I don't need it to be unique, just per user voting.
Does application support that ?
Thank you.
Sometimes I'm getting errors like this when voting for the first time :
Traceback:
File "/opt/envs/tworoads/lib/python3.5/site-packages/updown/fields.py" in add
108. rating, created = Vote.objects.get(**kwargs), False
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/models/query.py" in get
385. self.model._meta.object_name
During handling of the above exception (Vote matching query does not exist.), another exception occurred:
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
64. return self.cursor.execute(sql, params)
The above exception (duplicate key value violates unique constraint "updown_vote_content_type_id_af6fe292_uniq"
DETAIL: Key (content_type_id, object_id, key, user_id, ip_address)=(20, 117, dfa5be7e620204da91e72a33294e9798, 3, 127.0.0.1) already exists.
) was the direct cause of the following exception:
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
39. response = get_response(request)
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/envs/tworoads/lib/python3.5/site-packages/updown/views.py" in call
105. request, content_type.id, object_id, field_name, score)
File "/opt/envs/tworoads/lib/python3.5/site-packages/updown/views.py" in call
42. field.add(score, request.user, request.META['REMOTE_ADDR'])
File "/opt/envs/tworoads/lib/python3.5/site-packages/updown/fields.py" in add
111. rating, created = Vote.objects.create(**kwargs), True
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
85. return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/models/query.py" in create
399. obj.save(force_insert=True, using=self.db)
File "/opt/envs/tworoads/lib/python3.5/site-packages/updown/models.py" in save
43. super(Vote, self).save(*args, **kwargs)
File "/opt/envs/tworoads/lib/python3.5/site-packages/django/db/models/base.py" in save
796. force_update=force_update, update_fields=update_fields)
Hi, thanks for great application.
REMOTE_ADDR is always 127.0.0.1 and I don't need it to be unique, just per user voting.
Does application support that ?
Thank you.
Sometimes I'm getting errors like this when voting for the first time :
The text was updated successfully, but these errors were encountered: