Uploaded image for project: 'CritiqueBrainz'
  1. CritiqueBrainz
  2. CB-368

Submitting a review, clicking back, and submitting again causes error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • v-2020-10-09.0
    • None
    • None
    • None

      If I submit a review and click the back button I can submit the review again. When I do this, I get the following error:

      sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "review_entity_id_user_id_key" DETAIL: Key (entity_id, user_id)=(0383dadf-2a4e-4d10-a46a-e9e041da8eb3, dd038ddf-cf4c-45f9-afdd-c98abf39abea) already exists.
      
       
      h4. File ??"/code/critiquebrainz/frontend/views/review.py"??, line _249_, in {{create}}
       
              review = db_review.create(user_id=current_user.id, entity_id=entity_id, entity_type=entity_type,
                                        text=form.text.data, rating=form.rating.data, license_id=form.license_choice.data,
                                        language=form.language.data, is_draft=is_draft)

            kartik1712 amCap1712
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Version Package
                v-2020-10-09.0