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 4024038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:40:20+00:00 2026-05-20T10:40:20+00:00

Hello I have a view that deletes order numbers. Once a string has been

  • 0

Hello I have a view that deletes order numbers. Once a string has been deleted, the web page redirects to the clients page letting the user know that the order number was deleted. There is a problem. I am getting this.

Previous order None deleted

It says None but I want it to state the order number that I have deleted. It seems it says none because I have already deleted that order number so when it looks in the order number list, it cannot find that number.

EDIT: here is the solution. Order number should be deleted after the message is sent.

   def delete_confirmation(request, order_no = 0, service_type = 0):
        order = None
        count = 0
        title = models.SERVICE_CHOICES[int(service_type) - 1][1]
        #title = type[1]
        order_number = request.session['order_number']
        try:
            order = models.Order.objects.get(pk = order_no)
            count = order.orderservicelist_set.count()
            if request.POST.get('delete'):
                request.user.message_set.create(message = "Previous order " + str(order_number.pk) + "  deleted")
                order_number.delete()
                return HttpResponseRedirect(reverse(return_clients))

        except:
            return HttpResponseRedirect(reverse(return_clients))
        return render_to_response('delete_order.html', {'order':order, 'title':title, 'count':count, 'order_no':order_no }, context_instance = RequestContext(request))
  • 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-20T10:40:21+00:00Added an answer on May 20, 2026 at 10:40 am

    Very Careless mistake. why have I got order_number.delete() written twice?

    if request.POST.get('delete'):
        order_number.delete() # Why was this there? of course, if I have this it will delete till it gets to the next part where it informs the user which order number was deleted! 
        request.user.message_set.create(message = "Previous order " + str(order_number.pk) + "  deleted")
        order_number.delete()
    

    fixed

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

Sidebar

Related Questions

I have a very simple Mac Cocoa app that just has a Web View
Hello I have a view controller that loads from an xib i created. It
hello i am having table view and in that table view i have put
Imagine I have the following: inFile = /adda/adas/sdas/hello.txt # that instruction give me hello.txt
Say for example I have the following string: var testString = Hello, world; And
Hello i have a list view control, While the form is being loaded i
I have a Javascript statement in an MVC view that looks like this and
Hello I have some javascript code, a script included inside my page. I want
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello we have an SQL server application running over a low bandwith connection. We

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.