Commit 028bbdd7 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

rebasing is annoying-- small bid fixes

parent fb02c023
{% extends 'layouts/base.html' %} {% extends 'layouts/base.html' %}
{% block title %} {% block title %}
SRCT Bookshare • {{ listing.title }} • Edit Bid SRCT Bookshare • {{ bid.listing.title }} • Edit Bid
{% endblock %} {% endblock %}
{% block content %} {% block content %}
......
...@@ -285,6 +285,7 @@ class DeleteFlag(LoginRequiredMixin, DeleteView): ...@@ -285,6 +285,7 @@ class DeleteFlag(LoginRequiredMixin, DeleteView):
return context return context
# not implemented -- tbd
class DeleteBid(LoginRequiredMixin, DeleteView): class DeleteBid(LoginRequiredMixin, DeleteView):
model = Bid model = Bid
success_url = '/' success_url = '/'
...@@ -299,7 +300,7 @@ class EditBid(LoginRequiredMixin, FormValidMessageMixin, UpdateView): ...@@ -299,7 +300,7 @@ class EditBid(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
#form_class = EditBidForm #form_class = EditBidForm
login_url = 'login' login_url = 'login'
form_valid_message = "Your listing was successfully updated!" form_valid_message = "Your bid was successfully updated!"
fields = ['price', 'text', ] fields = ['price', 'text', ]
...@@ -319,7 +320,8 @@ class EditBid(LoginRequiredMixin, FormValidMessageMixin, UpdateView): ...@@ -319,7 +320,8 @@ class EditBid(LoginRequiredMixin, FormValidMessageMixin, UpdateView):
if not(bidding_student == me): if not(bidding_student == me):
return HttpResponseForbidden() return HttpResponseForbidden()
if bid.listing.sold or bid.listing.cancelled: # if sold or cancelled, this page doesn't exist
if self.get_object().listing.sold or self.get_object().listing.cancelled:
raise Http404 raise Http404
return context return context
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment