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:
parent
51c044bd94
commit
37544700d5
@ -1,5 +1,6 @@
|
|||||||
import boto3
|
import boto3
|
||||||
import pymongo
|
import pymongo
|
||||||
|
import urllib
|
||||||
from datetime import datetime, date, timedelta
|
from datetime import datetime, date, timedelta
|
||||||
from botocore.exceptions import ClientError
|
from botocore.exceptions import ClientError
|
||||||
from bson.objectid import ObjectId
|
from bson.objectid import ObjectId
|
||||||
@ -30,6 +31,7 @@ def view_inventory_view(item_id):
|
|||||||
if not item["inventory"].get("public"):
|
if not item["inventory"].get("public"):
|
||||||
return do_login()
|
return do_login()
|
||||||
template = "inventory_view_public.html"
|
template = "inventory_view_public.html"
|
||||||
|
redirect_url = urllib.parse.quote_plus(request.full_path)
|
||||||
else:
|
else:
|
||||||
can_audit = "k-space:janitors" in user["groups"]
|
can_audit = "k-space:janitors" in user["groups"]
|
||||||
can_edit = check_edit_permission(item_id)
|
can_edit = check_edit_permission(item_id)
|
||||||
|
@ -208,7 +208,7 @@ def name_check(form, field):
|
|||||||
@app.route("/login")
|
@app.route("/login")
|
||||||
@login_required
|
@login_required
|
||||||
def login_dummy():
|
def login_dummy():
|
||||||
return redirect("/m/inventory")
|
return redirect(request.args.get("redirect_url", "/m/inventory"))
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<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>
|
<p>Inventory item.</p>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
Loading…
Reference in New Issue
Block a user