How can I prevent some fields values from being changed automatically in my django application?

I have a django app and it contains an onboarding for the user, during this onboarding, two fields are changed, stage field (Text choices between (New, Demo, PAID)) and subscription_end_date (Datetime fields when the user pays). the problem is the onboarding goes well and at the last step the stage is changed to PAID and subscription_end_date has a value. After about 5 minutes (may be less may be more each time) I find that the stage returns back to Demo and subscription_end_date returns back to null automtically. These are the inputs regarding this bug that I have:

  • There is no signal or celery task that do this and I am sure of that.
  • There is no API allows the frontend to change the value of those fields.
  • In most of the times I find that in django admin log entry those fields are changed without any user changing them.
  • I added a signal that prevents the stage to be changed from PAID to DEMO and I found that PAID is changed NEW
  • My app is setup using docker. I have redis and celery containers and postgres DB.

I have tried to see the source of changing and found that It is most propably django admin (Because I found the change in log entries of django admin ), but I can’t make sure of that because what I know about django admin that it doesn’t do any automated tasks.

It’s going to be tough to try and diagnose this without seeing the complete project.

For example, what are all the third-party packages that you have installed?

How exactly have you configured and set up your docker containers? What are redis and celery doing? Do you have Celery Beat running? Is PostgreSQL running on the host or in a container? If a container, is it accessing a mounted volume for data? What else might be accessing that volume?

Can you recreate this behavior outside the docker environment. Do you see this when all these components are running natively? You might find it useful to “de-docker” components one-at-a-time until you identify what’s causing this.

Fundamentally I agree with your original conclusion - I’m not aware of any way that it’s the admin doing this - so then I’d be looking at everything else.