Closed AmberSJones closed 6 years ago
Been testing with this. I see the site visits you're mentioning but have been unable to replicate this behavior. Each site-visit I create seems fine. 971, then 972. So far no ghost visits. Any more details on getting this to happen?
This occurred for me again today. I think any time a site visit is attempted that doesn't go through, it creates a "ghost" by taking that ID. The two successful site visits that I created today have IDs of 1039 and 1042. There were probably 2 that failed in between them. I notice that prior to those two site visits, the next two previous have IDs of 1029 and 1031, which @Elijahwalkerwest created. So, something happened to 1030 as well as with everything 1032-1038. For example, try looking at http://django.uwrl.usu.edu/equipment/actions/visit-detail/1036/. There's something there, but it doesn't show up in the list of site visits.
This is not ghost site visits being created.
These are other actions. Which is why they don't show up in the list of site visits.
All Actions create an Action object, and various other objects. So What's happening here is if you create a site visit (Say, action id 1) and that visit has two actions, these two actions will be created with id's 2, and 3.
Then the next site visit you create will have the ID 4.
No ghosts are being created, you're just manually entering in an ID of a valid action, in the site visit URL. Which the detail view see's a valid Action object, and returns you the Site Visit Template.
This same issue occurs at basically every other "Detail" page. You can plug in a site visit ID or the deployment details page, and it will show you a deployment with no data, it isn't that there's a ghost deployment, but rather the Action is a Site Visit, not a Deployment.
I've been slowly working fixes to this in, so far I have only done it for I believe Retrievals, I'll get around to doing the rest.
Resolved and ready to test. It should now properly display a 404 if you attempt to reference the wrong type of action from a given details URL.
I.E. http://django.uwrl.usu.edu/equipment/actions/visit-detail/1036/
Should now return a 404, instead of an empty site visit, since that ID is in fact an Instrument Calibration.
Likewise: http://django.uwrl.usu.edu/equipment/actions/calibration-detail/1051/
Should return a 404, since 1051 is the ID for a Site Visit Action.
This should work for all detail pages.
Ok - this makes sense. Thanks for shedding some light. I haven't been able to completely verify it, but closing.
As I am trying to create site visits (and having issues doing so), I notice that the successfullly created actions have IDs of 950 and 957.
So I type into the URL for action IDs in between 950 and 957. There are generic site visit actions associated with those IDs.