stencila/hub

IntegrityError: duplicate key value violates unique constraint "source_unique_project_address"

Closed this issue ยท 1 comments

This error occurs when a user attempts to create a new source that is the same as one that already exists - instead of the user getting a message that it already exists, it fails silently.

Instead, a ValidationError should be raised so that it appears on the form.

Sentry Issue: HUB-104

UniqueViolation: duplicate key value violates unique constraint "source_unique_project_address"
DETAIL:  Key (project_id, address)=(1334, github://luismmontilla/cordix/data/ybd_pollutants_dataset.csv) already exists.

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

IntegrityError: duplicate key value violates unique constraint "source_unique_project_address"
DETAIL:  Key (project_id, address)=(1334, github://luismmontilla/cordix/data/ybd_pollutants_dataset.csv) already exists.

(18 additional frame(s) were not displayed)
...
  File "django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

๐ŸŽ‰ This issue has been resolved in version 4.24.1 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€