Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #6398

Closed
Open
Created Feb 24, 2014 by Administrator@rootOwner

Unable to edit administrator via user administration panel

Created by: Spy-Seth

As an administrator, if I try to edit myself (the current administrator account) in the user edit panel in the admin area, I trigger this error :

Started PATCH "/admin/users/spy-seth" for 217.xxx.xxx.xxx at 2014-02-24 14:09:30 +0100
Processing by Admin::UsersController#update as HTML
  Parameters: {
    "utf8"=>"✓", 
    "authenticity_token"=>"[...]", 
    "user"=>{
        "name"=>"[...]", 
        "username"=>"[...]", 
        "email"=>"[...]", 
        "password"=>"[FILTERED]", 
        "password_confirmation"=>"[FILTERED]", 
        "projects_limit"=>"1000", 
        "can_create_group"=>"1", 
        "skype"=>"[...]", 
        "linkedin"=>"[...]", 
        "twitter"=>"[...]", 
        "website_url"=>"http://forgebinaire.net"
    }, 
    "id"=>"[...]"
  }
PG::Error: ERREUR:  une valeur NULL viole la contrainte NOT NULL de la colonne « admin »
: UPDATE "users" SET "admin" = $1, "projects_limit" = $2, "updated_at" = $3 WHERE "users"."id" = 1
Completed 500 Internal Server Error in 60ms

ActiveRecord::StatementInvalid (PG::Error: ERREUR:  une valeur NULL viole la contrainte NOT NULL de la colonne « admin »
: UPDATE "users" SET "admin" = $1, "projects_limit" = $2, "updated_at" = $3 WHERE "users"."id" = 1):
  app/controllers/admin/users_controller.rb:74:in `block in update'
  app/controllers/admin/users_controller.rb:73:in `update'
  app/controllers/application_controller.rb:57:in `set_current_user_for_thread'

It seems the "admin" field is missing in the query.

This is cause by the "disabled" attibute on the "admin" checkbox. When I remove this attribute in the DOM before send the form. All works fine.

That probably because a disabled HTML checkbox is not send by the browser in a form.

Assignee
Assign to
Time tracking