Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6081653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:12:00+00:00 2026-05-23T11:12:00+00:00

There’s some functionality on our Django app that displays a link to refresh some

  • 0

There’s some functionality on our Django app that displays a link to refresh some information from our version control system. This is simply a link, and when they hit that URL the actions of going to version control, getting the information, checking it against the database and updating the database are performed.

Recently we had a user click the ‘refresh’ button twice for one asset. This resulted in the URL being hit twice, so the operations were performed twice and eventually a duplicate entry was created in our database.

We need to do something to remove the possibility of the user clicking that button twice. Should we move from a link to a javascript button? Should we set some flag in request.session as soon as the first click happens, then unset it upon completion, and always check that flag when performing a refresh? Those are just two ideas that seem feasible, but I really don’t know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:12:01+00:00Added an answer on May 23, 2026 at 11:12 am

    You should use POST request and redirect after it, really.

    Also, to prevent double submitting, you can employ a solution like one from this question: Does a library to prevent duplicate form submissions exist for django?. You can store a key refreshing_vcs in request.session and check its value in your view. If the data is already being refreshed, then you can redirect user to another page and tell to wait a bit.

    Completely another way would be to setup a django-celery task (or simply use cron) to perform updates at regular intervals automatically, but I don’t know whether it suit your requirements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There's a thrird party app that needs to get information via custom http headers,
There are some Magento Connect extensions that I find myself installing every time I
There are many tutorials that talk about deleting index.php from the url. But I
There are some posts that asks what the difference between those two are already.
There is a conversion process that is needed when migrating Visual Studio 2005 web
There is a field in my company's Contacts table. In that table, there is
For some reason, after submitting a string like this Jack’s Spindle from a text
There's a column on one of my tables that's being updated by various INSERT/DELETE
There are a lot of example implementations of daemons on the net. Most that
There is a QListWidget containing keywords for search and a QTextEdit containing some text.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.