Skip to content

PG:NotNullViolation in ParticipatoryProcesses weight  #7483

@andreslucena

Description

@andreslucena

Describe the bug

As an administrator I can't create Participatory Processes.

I have an exception: ActiveRecord::NotNullViolation in Decidim::ParticipatoryProcesses::Admin::ParticipatoryProcessesController#create

To Reproduce
Steps to reproduce the behavior:

  1. Sign in as administrator
  2. Go to http://localhost:3000/admin/participatory_processes/new
  3. Fill only the mandatory fields with any string (for instance "Test")
  4. Save the form
  5. See error

Expected behavior
To be able to save the participatory process or to have the weight as mandatory; it should be consistent with others weight fields in the platform.

Screenshots
imatge

imatge

Stacktrace

 ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR:  null value in column "weight" violates not-null constraint
DETAIL:  Failing row contains (5, test, , 1, 2021-03-01 10:39:48.01089, 2021-03-01 10:39:48.01089, {"ca": "Test", "en": "Test", "es": "Test"}, {"ca": "Test", "en": "Test", "es": "Test"}, {"ca": "<p>Test</p>", "en": "<p>Test</p>", "es": "<p>Test</p>"}, {"ca": "<p>Test</p>", "en": "<p>Test</p>", "es": "<p>Test</p>"}, null, null, f, null, {"ca": "", "en": "", "es": ""}, null, {"ca": "", "en": "", "es": ""}, {"ca": "", "en": "", "es": ""}, {"ca": "", "en": "", "es": ""}, {"ca": "", "en": "", "es": ""}, {"ca": "", "en": "", "es": ""}, null, null, t, null, f, null, f, null, null, null, t, null).
: INSERT INTO "decidim_participatory_processes" ("slug", "hashtag", "decidim_organization_id", "created_at", "updated_at", "title", "subtitle", "short_description", "description", "developer_group", "meta_scope", "local_area", "target", "participatory_scope", "participatory_structure", "scopes_enabled", "weight") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING "id"):

Extra data (please complete the following information):

  • Decidim Version: 0.24.dev
  • Decidim installation: local

Additional context

Related to #7283 - mind that's implemented in Assemblies so it's probably broken there also.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions