{"action":"created","issue":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/1153","labels_url":"https://api.github.com/repos/snipe/snipe-it/issues/1153/labels{/name}","comments_url":"https://api.github.com/repos/snipe/snipe-it/issues/1153/comments","events_url":"https://api.github.com/repos/snipe/snipe-it/issues/1153/events","html_url":"https://github.com/snipe/snipe-it/issues/1153","id":105030161,"number":1153,"title":"Location Cannot Be Deleted","user":{"login":"leobg","id":10868370,"avatar_url":"https://avatars.githubusercontent.com/u/10868370?v=3","gravatar_id":"","url":"https://api.github.com/users/leobg","html_url":"https://github.com/leobg","followers_url":"https://api.github.com/users/leobg/followers","following_url":"https://api.github.com/users/leobg/following{/other_user}","gists_url":"https://api.github.com/users/leobg/gists{/gist_id}","starred_url":"https://api.github.com/users/leobg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leobg/subscriptions","organizations_url":"https://api.github.com/users/leobg/orgs","repos_url":"https://api.github.com/users/leobg/repos","events_url":"https://api.github.com/users/leobg/events{/privacy}","received_events_url":"https://api.github.com/users/leobg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/snipe/snipe-it/labels/waiting%20on%20OP","name":"waiting on OP","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-05T14:47:11Z","updated_at":"2015-09-11T20:36:25Z","closed_at":null,"body":"I am trying to delete a location I no longer use, but snipe-it refuses to do so as it claims there is at least one asset that is associated with this location. I have not found way to run asset report by location (except by showing all assets and filter by location name, which says I have no assets in the questionable location). However if I go to Admin/Locations - the assets column says '1' for that location I am trying to delete. I have gone through every single asset on in the system, none is associated to this location. I have several assets not associated to any location, not sure if that triggers the flag for the location I am trying to delete. I tried querying the database (table assets, column 'rtd_location_id' but this also tells me I have no assets associated to that location). I'm wondering if this is a bug of some sort.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26472106-location-cannot-be-deleted?utm_campaign=plugin&utm_content=tracker%2F505106&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F505106&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/snipe/snipe-it/issues/comments/139655977","html_url":"https://github.com/snipe/snipe-it/issues/1153#issuecomment-139655977","issue_url":"https://api.github.com/repos/snipe/snipe-it/issues/1153","id":139655977,"user":{"login":"leobg","id":10868370,"avatar_url":"https://avatars.githubusercontent.com/u/10868370?v=3","gravatar_id":"","url":"https://api.github.com/users/leobg","html_url":"https://github.com/leobg","followers_url":"https://api.github.com/users/leobg/followers","following_url":"https://api.github.com/users/leobg/following{/other_user}","gists_url":"https://api.github.com/users/leobg/gists{/gist_id}","starred_url":"https://api.github.com/users/leobg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leobg/subscriptions","organizations_url":"https://api.github.com/users/leobg/orgs","repos_url":"https://api.github.com/users/leobg/repos","events_url":"https://api.github.com/users/leobg/events{/privacy}","received_events_url":"https://api.github.com/users/leobg/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T20:36:25Z","updated_at":"2015-09-11T20:36:25Z","body":"Sorry for the long silence! Found the sucker finally! It was in asset_logs. And I think I figured why it happened. The user that asset is checked out used to be in that location I am trying to delete. The user since moved to another location along with the asset and everything. I have changed the user to the new location, as well as the asset. But the log entry about the checkout remained unchanged. I guess problem could have gone away if I checked in the assets, then check back out.\r\nNot sure if it is a good idea to introduce a trigger when user gets location changed to automatically check-in/out all associated assets to address issues like that."}}