Skip to content

Commit

Permalink
new bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mjg79 committed Jan 21, 2019
1 parent 9325cac commit 8451a2d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion apps/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,19 @@ def complete_profile(request):


def login(request):
next = request.GET.get('next', reverse('home'))
if request.user.is_authenticated:
return HttpResponseRedirect(reverse('home'))
next = request.GET.get('next', reverse('home'))

if request.method == 'POST':
form = SignInForm(request.POST)
if form.is_valid():
cd = form.cleaned_data
user = form.user
dj_login(request, user)
next = request.POST.get('next')
if next == None:
next = request.GET.get('next', reverse('home'))
return HttpResponseRedirect(next)
else:
form = SignInForm()
Expand Down
3 changes: 3 additions & 0 deletions apps/locker/templates/locker.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ <h2 class="mb-4 mx-2 px-4 text-white border-right-white">رزرو کمد</h2>
تحویل آن و مطابق
بندهای فوق مبلغ 35 هزار تومان به شما بازگردانده خواهد شد.
</li>
<li>
پس از دریافت کمد به هر دلیلی اگر پرداخت شما صحیح نباشد کمد پس از مدتی از شما پس گرفته می شود.
</li>
</ol>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/locker/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def add_new(request):
def payment(request, rack_id):
Rack = get_object_or_404(rack, id=rack_id)
if request.method == "POST":
if Rack.payment==True:
if Rack.payment==True and Rack.receiver != request.user:
return HttpResponse('someone else is on payment for this locker')
moneyt = 40000
Sell = sell(value=moneyt, locker=Rack, is_success=False)
Expand Down
3 changes: 3 additions & 0 deletions templates/base_of_new_website.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ <h4 class="modal-title ml-auto">ورود</h4>
<input class="custom-control-input" type="checkbox" id="remember-me">
<label class="custom-control-label" for="remember-me"> مرا به خاطر بسپار </label>
</div>
<div>
<input type="hidden" name="next" value="{{request.path}}">
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">برو!</button>
<a role="button" class="btn btn-outline-primary" href="{% url 'password_reset_recover' %}">فراموشی
Expand Down

0 comments on commit 8451a2d

Please sign in to comment.