snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Newly created users marked as "Active"

Open xWyatt opened this issue 10 years ago • 3 comments

Expected Behavior (or desired behavior if a feature request)

When creating a user and marking the Active box as No I expect that the user is marked as not active.


Actual Behavior

The user is marked active in the users list. I can edit the user and mark them as inactive and it sticks after I create them.


Please confirm you have done the following before posting your bug report:


Please provide answers to these questions before posting your bug report:

  • Version of Snipe-IT you're running: V3.0.0 - dev - 3
  • What OS and web server you're running Snipe-IT on: Ubuntu Server 16.04LTS - Apache2
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc): Manual install
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error:/admin/users/create - creating a new user
  • Confirm whether the error is reproduceable on the demo. **I can reproduce it on the V3 demo.
  • Indicate whether or not you've manually edited any data directly in the database: Why on Earth would I do that? (of course not :P )

xWyatt avatar Jun 27 '16 14:06 xWyatt

When the user is created, the activated parameter is set to one and ignores the checkbox input. This issue is either one of two bugs.

1)(Most likely) The activated checkbox should be respected--an easy fix.

  1. If it's intentional that users are created active, we should hide the activated checkbox in getCreate() but not getEdit(). Also easy.

I'm not going to make a PR because I'm not sure which is the "correct" solution. I think the first one makes more sense, but I'm not sure if there is a reason that activated was hardcoded to 1.

mnemonicly avatar Jun 27 '16 17:06 mnemonicly

I also just noticed that it doesn't take the company parameter when creating a user either. It just leaves it blank, but can be edited later. Could this be related?

xWyatt avatar Jun 27 '16 17:06 xWyatt

Looking closer, postCreate ignores a whole bunch of things postEdit doesn't. I'm thinking it's a bug. I'll put together a fix later today if snipe doesn't get to it first.

mnemonicly avatar Jun 27 '16 17:06 mnemonicly