Fix login endpoint redirect
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline was successful
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	ci/woodpecker/push/woodpecker Pipeline was successful
				
			This commit is contained in:
		@@ -1,5 +1,6 @@
 | 
			
		||||
import boto3
 | 
			
		||||
import pymongo
 | 
			
		||||
import urllib
 | 
			
		||||
from datetime import datetime, date, timedelta
 | 
			
		||||
from botocore.exceptions import ClientError
 | 
			
		||||
from bson.objectid import ObjectId
 | 
			
		||||
@@ -30,6 +31,7 @@ def view_inventory_view(item_id):
 | 
			
		||||
        if not item["inventory"].get("public"):
 | 
			
		||||
            return do_login()
 | 
			
		||||
        template = "inventory_view_public.html"
 | 
			
		||||
        redirect_url = urllib.parse.quote_plus(request.full_path)
 | 
			
		||||
    else:
 | 
			
		||||
        can_audit = "k-space:janitors" in user["groups"]
 | 
			
		||||
        can_edit = check_edit_permission(item_id)
 | 
			
		||||
 
 | 
			
		||||
@@ -208,7 +208,7 @@ def name_check(form, field):
 | 
			
		||||
@app.route("/login")
 | 
			
		||||
@login_required
 | 
			
		||||
def login_dummy():
 | 
			
		||||
    return redirect("/m/inventory")
 | 
			
		||||
    return redirect(request.args.get("redirect_url", "/m/inventory"))
 | 
			
		||||
 | 
			
		||||
@app.route("/")
 | 
			
		||||
def index():
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
{% extends 'base.html' %}
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="container">
 | 
			
		||||
<h6>Please <a href="/login">log in</a> to see more details</h6>
 | 
			
		||||
<h6>Please <a href="/login?redirect_url={{ redirect_url }}">log in</a> to see more details</h6>
 | 
			
		||||
<p>Inventory item.</p>
 | 
			
		||||
 | 
			
		||||
<table>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user