1. Fix(Authentication): User login on production. \n 2. Fix(SQL): Refactoring of Stock Items to include foreign key for Supplier Purchase Order, Manufacturing Purchase Order, and Customer Sales Order IDs.
This commit is contained in:
Binary file not shown.
@@ -159,9 +159,9 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
def from_form(form):
|
||||
av.val_instance(form, 'form', 'Parameters_User.from_form', Form_Filters_User)
|
||||
get_inactive = av.input_bool(form.active.data, "active", "Parameters_User.from_form")
|
||||
id_user = form.id_user.data
|
||||
id_user = '' if form.id_user.data is None else form.id_user.data
|
||||
return Parameters_User(
|
||||
get_all_user = (id_user is None),
|
||||
get_all_user = (id_user == ''),
|
||||
get_inactive_user = get_inactive,
|
||||
ids_user = id_user,
|
||||
ids_user_auth0 = '',
|
||||
@@ -173,7 +173,7 @@ class Parameters_User(Get_Many_Parameters_Base):
|
||||
return Parameters_User(
|
||||
get_all_user = ((user.id_user is None or user.id_user == 0) and user.id_user_auth0 is None),
|
||||
get_inactive_user = False,
|
||||
ids_user = user.id_user,
|
||||
ids_user = '' if user.id_user is None else str(user.id_user),
|
||||
ids_user_auth0 = user.id_user_auth0,
|
||||
)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -56,14 +56,6 @@ def login():
|
||||
try:
|
||||
Helper_App.console_log('login')
|
||||
Helper_App.console_log(f'method={request.method}')
|
||||
"""
|
||||
if request.method == 'OPTIONS':
|
||||
# Handle preflight request
|
||||
response = current_app.make_default_options_response()
|
||||
response.headers['Access-Control-Allow-Headers'] = f'Content-Type, {Model_View_Base.FLAG_CSRF_TOKEN}'
|
||||
response.headers['Access-Control-Allow-Methods'] = 'POST, OPTIONS'
|
||||
return response
|
||||
"""
|
||||
try:
|
||||
data = request.json
|
||||
try:
|
||||
@@ -127,6 +119,7 @@ def login():
|
||||
@routes_user.route("/login_callback") # <path:subpath>/<code>
|
||||
@handle_db_disconnect
|
||||
def login_callback():
|
||||
Helper_App.console_log('login_callback')
|
||||
try:
|
||||
error_state = request.args.get(Model_View_User.FLAG_ERROR_OAUTH)
|
||||
has_error = error_state is not None
|
||||
@@ -154,6 +147,7 @@ def login_callback():
|
||||
Helper_App.console_log(f'user ID: {id_user}')
|
||||
"""
|
||||
user = User.from_json_auth0(token) # datastore_user.get_user_auth0()
|
||||
Helper_App.console_log(f'user: {user}')
|
||||
filters = Parameters_User.from_user(user)
|
||||
datastore_user = DataStore_User()
|
||||
users, errors = datastore_user.get_many_user(filters, user)
|
||||
@@ -197,7 +191,6 @@ def logout():
|
||||
}# ,
|
||||
# quote_via=quote_plus,
|
||||
)
|
||||
current_app.logger.debug(f"Redirecting to {url_logout}")
|
||||
Helper_App.console_log(f"Redirecting to {url_logout}")
|
||||
return redirect(url_logout)
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,18 @@ DROP TABLE IF EXISTS Shop_Customer_Sales_Order_Product_Link_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Customer_Sales_Order_Product_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Customer_Sales_Order_Product_Link;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Customer_Sales_Order_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Customer_Sales_Order;
|
||||
|
||||
@@ -74,18 +86,10 @@ DROP TABLE IF EXISTS Shop_Customer_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Customer_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Customer;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Product_Link;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Manufacturing_Purchase_Order;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Product_Link;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Supplier_Purchase_Order;
|
||||
@@ -157,10 +161,6 @@ DROP TABLE IF EXISTS Shop_Product_Price_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Product_Price_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Product_Price;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item_Temp;
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Stock_Item;
|
||||
|
||||
DROP TABLE IF EXISTS Shop_Product_Currency_Region_Link_Audit;
|
||||
DROP TABLE IF EXISTS Shop_Product_Currency_Region_Link;
|
||||
DROP TABLE IF EXISTS Shop_Product_Currency_Link_Audit;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
# Stock Stock Item
|
||||
|
||||
-- DROP TABLE IF EXISTS Shop_Stock_Item_Audit;
|
||||
-- DROP TABLE IF EXISTS Shop_Stock_Item;
|
||||
|
||||
SELECT CONCAT('WARNING: Table ', TABLE_NAME, ' already exists.') AS msg_warning FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Shop_Stock_Item';
|
||||
@@ -11,15 +12,15 @@ CREATE TABLE IF NOT EXISTS Shop_Stock_Item (
|
||||
, CONSTRAINT FK_Shop_Stock_Item_id_permutation
|
||||
FOREIGN KEY (id_permutation)
|
||||
REFERENCES partsltd_prod.Shop_Product_Permutation(id_permutation)
|
||||
, id_supplier_purchase_order INT
|
||||
, id_supplier_purchase_order INT NULL
|
||||
, CONSTRAINT FK_Shop_Stock_Item_id_supplier_purchase_order
|
||||
FOREIGN KEY (id_supplier_purchase_order)
|
||||
REFERENCES partsltd_prod.Shop_Supplier_Purchase_Order(id_order)
|
||||
, id_manufacturing_purchase_order INT
|
||||
, id_manufacturing_purchase_order INT NULL
|
||||
, CONSTRAINT FK_Shop_Stock_Item_id_manufacturing_purchase_order
|
||||
FOREIGN KEY (id_manufacturing_purchase_order)
|
||||
REFERENCES partsltd_prod.Shop_Manufacturing_Purchase_Order(id_order)
|
||||
, id_customer_sales_order INT
|
||||
, id_customer_sales_order INT NULL
|
||||
, CONSTRAINT FK_Shop_Stock_Item_id_customer_sales_order
|
||||
FOREIGN KEY (id_customer_sales_order)
|
||||
REFERENCES partsltd_prod.Shop_Customer_Sales_Order(id_order)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
||||
|
||||
|
||||
-- File: combined.sql
|
||||
|
||||
GO
|
||||
|
||||
@@ -27,6 +27,7 @@ $output = New-Object System.Text.StringBuilder
|
||||
Get-ChildItem -Path $sourceFolder -Filter $filePattern -File |
|
||||
Where-Object { $_.Name -notin $excludeFiles -and $_.Name -ne $outputFileName } |
|
||||
ForEach-Object {
|
||||
Write-Host "Processing file: $($_.Name)"
|
||||
[void]$output.AppendLine("-- File: $($_.Name)")
|
||||
# Read file content and remove BOM if present
|
||||
$content = [System.IO.File]::ReadAllBytes($_.FullName)
|
||||
|
||||
Reference in New Issue
Block a user