Fix: User login on production.
This commit is contained in:
121
app.log.1
121
app.log.1
@@ -1,121 +0,0 @@
|
||||
Traceback: Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
|
||||
rv = self.dispatch_request()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
|
||||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_category.py", line 56, in categories
|
||||
model = Model_View_Store_Product_Category(form_filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_product_category.py", line 46, in __init__
|
||||
super().__init__(hash_page_current=hash_page_current, form_filters_old=form_filters_old) # filters_category=filters_category)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store.py", line 232, in __init__
|
||||
super().__init__(hash_page_current=hash_page_current, **kwargs)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_base.py", line 262, in __init__
|
||||
BaseModel.__init__(self, hash_page_current=hash_page_current, **kwargs)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\pydantic\main.py", line 193, in __init__
|
||||
self.__pydantic_validator__.validate_python(data, self_instance=self)
|
||||
pydantic_core._pydantic_core.ValidationError: 1 validation error for Model_View_Store_Product_Category
|
||||
form_filters
|
||||
Field required [type=missing, input_value={'hash_page_current': '/s...pty=False, active=True)}, input_type=dict]
|
||||
For further information visit https://errors.pydantic.dev/2.8/v/missing
|
||||
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
Server Error: list object has no element 0
|
||||
Request: 127.0.0.1 GET http /store/permutations?id_category=&id_product=&is_out_of_stock=false&quantity_min=&quantity_max= Host: 127.0.0.1:5000
|
||||
|
||||
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
|
||||
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
||||
|
||||
Accept-Language: en-GB,en;q=0.5
|
||||
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
|
||||
Referer: http://127.0.0.1:5000/store/permutations
|
||||
|
||||
Dnt: 1
|
||||
|
||||
Connection: keep-alive
|
||||
|
||||
Cookie: session=.eJytVtmuo0gS_ZWWpe6ntovdcKXSjDcw2GCbHV4sIBOzg1kNPfXvk_hWd_VDzyaNZExmRhDnRGZkRPy28Lo2Kuu4gcBoYL34-G0ReMXdA3lc3Ju2rOHio607-Ouflru34ucqzL04W3wsIBi8GqzyGIAMtm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xM8OgXgOKHf2j-abJBIwhWVTFXLMRoPm9Wyl_6_VGe_e1rJ22MpQi6Hc1EkUM9xJiZFTv_v-nVugp4LerG5sNYEBhBLXF8iVM6jn9Q2AfOrlhu7S6-ffv2T-GRoaE.ZzXhpA.6IaVZ-sABN4LB476tj7c1hUx5F8
|
||||
|
||||
Upgrade-Insecure-Requests: 1
|
||||
|
||||
Sec-Fetch-Dest: document
|
||||
|
||||
Sec-Fetch-Mode: navigate
|
||||
|
||||
Sec-Fetch-Site: same-origin
|
||||
|
||||
Sec-Fetch-User: ?1
|
||||
|
||||
Sec-Gpc: 1
|
||||
|
||||
Priority: u=0, i
|
||||
|
||||
|
||||
|
||||
|
||||
Request data: b''
|
||||
Traceback: Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
|
||||
rv = self.dispatch_request()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
|
||||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\product_permutation.py", line 47, in permutations
|
||||
return render_template('pages/store/_product_permutations.html', model = model)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template
|
||||
return _render(app, template, context)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render
|
||||
rv = template.render(context)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render
|
||||
self.environment.handle_exception()
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception
|
||||
raise rewrite_traceback_stack(source=source)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_product_permutations.html", line 1, in top-level template code
|
||||
{% extends 'layouts/layout.html' %}
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 357, in top-level template code
|
||||
{% block page_body %}{% endblock %}
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_product_permutations.html", line 108, in block 'page_body'
|
||||
{% include 'components/store/_row_product_permutation.html' %}
|
||||
106
app.log.2
106
app.log.2
@@ -1,106 +0,0 @@
|
||||
Traceback: Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context
|
||||
self.dialect.do_execute(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute
|
||||
cursor.execute(statement, parameters)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
||||
res = self._query(mogrified_query)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
||||
db.query(q)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query
|
||||
_mysql.connection.query(self, query)
|
||||
MySQLdb.OperationalError: (1054, "Unknown column 'v_id_permission_manufacturing' in 'where clause'")
|
||||
|
||||
The above exception was the direct cause of the following exception:
|
||||
|
||||
Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
|
||||
rv = self.dispatch_request()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
|
||||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\manufacturing_purchase_order.py", line 40, in manufacturing_purchase_orders
|
||||
model = Model_View_Store_Manufacturing_Purchase_Order(form_filters)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\models\model_view_store_manufacturing_purchase_order.py", line 50, in __init__
|
||||
self.manufacturing_purchase_orders, errors = datastore_manufacturing_purchase_order.get_many_manufacturing_purchase_order(parameters_manufacturing_purchase_order)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_store_manufacturing_purchase_order.py", line 51, in get_many_manufacturing_purchase_order
|
||||
result = self.db_procedure_execute('p_shop_get_many_manufacturing_purchase_order', argument_dict)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\datastores\datastore_base.py", line 95, in db_procedure_execute
|
||||
result = db.session.execute(proc_string, argument_dict_list)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\scoping.py", line 778, in execute
|
||||
return self._proxied.execute(
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2351, in execute
|
||||
return self._execute_internal(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\orm\session.py", line 2245, in _execute_internal
|
||||
result = conn.execute(
|
||||
^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1418, in execute
|
||||
return meth(
|
||||
^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\sql\elements.py", line 515, in _execute_on_connection
|
||||
return connection._execute_clauseelement(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1640, in _execute_clauseelement
|
||||
ret = self._execute_context(
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1846, in _execute_context
|
||||
return self._exec_single_context(
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1986, in _exec_single_context
|
||||
self._handle_dbapi_exception(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 2353, in _handle_dbapi_exception
|
||||
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\base.py", line 1967, in _exec_single_context
|
||||
self.dialect.do_execute(
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\sqlalchemy\engine\default.py", line 924, in do_execute
|
||||
cursor.execute(statement, parameters)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 179, in execute
|
||||
res = self._query(mogrified_query)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\cursors.py", line 330, in _query
|
||||
db.query(q)
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\MySQLdb\connections.py", line 261, in query
|
||||
_mysql.connection.query(self, query)
|
||||
sqlalchemy.exc.OperationalError: (MySQLdb.OperationalError) (1054, "Unknown column 'v_id_permission_manufacturing' in 'where clause'")
|
||||
[SQL: CALL p_shop_get_many_manufacturing_purchase_order(%s, %s, %s, %s, %s, %s, %s, %s)]
|
||||
[parameters: (0, True, True, '', '', None, None, 0)]
|
||||
(Background on this error at: https://sqlalche.me/e/20/e3q8)
|
||||
|
||||
config_env: production
|
||||
config_env: production
|
||||
config_env: production
|
||||
config_env: production
|
||||
config_env: production
|
||||
config_env: development
|
||||
config_env: development
|
||||
Server Error: 1 validation error for Model_View_Store_Product_Category
|
||||
form_filters
|
||||
Field required [type=missing, input_value={'hash_page_current': '/s...pty=False, active=True)}, input_type=dict]
|
||||
For further information visit https://errors.pydantic.dev/2.8/v/missing
|
||||
Request: 127.0.0.1 GET http /store/categories? Host: 127.0.0.1:5000
|
||||
|
||||
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0
|
||||
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
|
||||
|
||||
Accept-Language: en-GB,en;q=0.5
|
||||
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
|
||||
Dnt: 1
|
||||
|
||||
Connection: keep-alive
|
||||
|
||||
Referer: http://127.0.0.1:5000/store/categories
|
||||
|
||||
Cookie: session=.eJytVtmuo0gS_ZWWpe6ntovdcKXSjDcw2GCbHV4sIBOzg1kNPfXvk_hWd_VDzyaNZExmRhDnRGZkRPy28Lo2Kuu4gcBoYL34-G0ReMXdA3lc3Ju2rOHio607-Ouflru34ucqzL04W3wsIBi8GqzyGIAMtmXR5HEb_f0xS1dBmS9-XYRx3bSFlyODCx0CMKK1GNyDrq5hEYx3AEOvy9rFR9Fl2VtUw0dcFn8h-CSA_zG-z05gyO77_Q-GZgmfowOWowHGeWvM93AshOEM2NzfjO89rOMwhmDxEXpZA9-SuAiyDkBwNzf6D9RPP5G46SoE9Wfnm67-7pD8u99LbXZ88Q3tV1OH97ZMYYHkHAkgZABYhxgGOQwyGEOGuB_iBLEOfRKHGOkTJPQRxe77MXhBAJvmDwtwlCJfCOJLLKWeLcbnnZT5uTzPt3JiECqmKGI8xJ6tTGJSxt5RxYKjzJxHLnVtp_ULEHmTOCiJm7mJW16EjPJjGg9GOgK2Wso7OvEJrBcLbLW6iUk2Euo6LDXq0qyj1TVjFW4k61ZVlVpa5mvCyXbDpDzymuW2e-i47ZGEpHDjRHc3WaxVT9YxIa5w3Mk1TqX9w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REVdewvuvrK8X4xLbyyJrjxZfUCF62UymvKZO2q167L2dHXChML8wn4R1fIGTuvjtHTLV8JIhr0BjrJN3YErqpMBG7avByBPPQ-PGZMfgLvnzjlIz9qV6-s2pCe473zeHjLSk5-0aoRFLRNbO7zZxXVoeEnjDcffOQ912Fy14zCCyjR0domBWwAAt2zynvYEGTNkcmDkgGf8lr1chdPJ1LbQxvu41bL9QV13yZRjvo2zu4x6DuwZXiHHV-JlxDvPIBNafty8Q7pzbHLzDM4nvSEFOe_Kboux-0TzAXHs-43GCkzsDih_NUFZzZUR_Rcx-KmqyzDO4E-f_cKvi3fCurfjW2cLvRoVvc_aFxdh-a5_HSrOi4eQjO1Tka1dpMWv52VNqLfJPFobD0oSut-L_6UF-RelH6XU7zmWwCicQwn196RLs9TnQtMggKhtq-bjyxcA-2UxeCmBMQwMmYiNX8Wqa1bv7mOG-oKwvjcG_5lUEQfpv1OeVcoimOXNDa8BKJ66JLNNDCznrFVIXMVB282N2h8Mm9Wj9nqv9eo3nc_hF5oEZEhQFLYGNEGvQ5YKiXXgYWt2TfmAof7WfKVY7Jf6a_X4BXx92_qZ3PxM8OgXgOKHf2j-abJBIwhWVTFXLMRoPm9Wyl_6_VGe_e1rJ22MpQi6Hc1EkUM9xJiZFTv_v-nVugp4LerG5sNYEBhBLXF8iVM6jn9Q2AfOrlhu7S6-ffv2T-GRoaE.ZzXhpA.6IaVZ-sABN4LB476tj7c1hUx5F8
|
||||
|
||||
Upgrade-Insecure-Requests: 1
|
||||
93
app.log.3
93
app.log.3
@@ -1,93 +0,0 @@
|
||||
Server Error: 'order' is undefined
|
||||
Request: 127.0.0.1 GET http /store/manufacturing_purchase_orders?active=true&date_from=&date_to= Host: 127.0.0.1:5000
|
||||
|
||||
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:131.0) Gecko/20100101 Firefox/131.0
|
||||
|
||||
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/png,image/svg+xml,*/*;q=0.8
|
||||
|
||||
Accept-Language: en-GB,en;q=0.5
|
||||
|
||||
Accept-Encoding: gzip, deflate, br, zstd
|
||||
|
||||
Referer: http://127.0.0.1:5000/store/manufacturing_purchase_orders
|
||||
|
||||
Dnt: 1
|
||||
|
||||
Connection: keep-alive
|
||||
|
||||
Cookie: session=.eJytVlnzokgS_yoTRsw8tTY3-I_omPUCRUFB5HohCgqkuOUQcba_-xba090PM3tErKFYVZlk_rLy_GMCujYua9SE8NKE9eTjj0kACg_AHBVe05Z1OPlo6y789NNx92J8n4Y5QNnkYxLCHtRwliMIs7AtiyZHbfyP60idBWU--TSJUN20BcixwIkRQjjgMwS9oKvrsAgGD4YR6LJ28lF0WfYi1eEVlcVfEN4AyO9rbzSCwHJf___kWIHy52wgzFlIzAFP-IAkojAaFTbeC7F3D2sUoRBOPiKQNeGLgoog62AIPXNh_ND6thOTm67Cqn42vunqbwYpf9o9PY-GT77i-2rqyGvLNCwwXRB4GvoszUOf8Sma4aM5iCDPBYAGfsBAjgwYBkQjxO6bG0AQhE3zXUI4yLEvBeiI5BTYO3RYyZmfK-N-qSQXSidUdYd6BGz1uUtKBLY6EWwV7jDMU9d2Wr-AMXjuejVxMzdxy6OUMT5iyWBgY2jrpbJiE58i7ruCmM2yYR07BymE20hQltPHzAY9BQ5hOOzkRxAuTpDfXPcBf1k5WqwkR7Pzbmia7hQa3oZpxisnehCEqiwqLNObAzdvJG9nZ-fl9rjyjuyFcKfF5tjXTqG5BwJJ0cUs_eXtcSMYLQMFeZUOmmYe2cUmhsxG7rWkCfa5LW7OMbewDZgF5Wmf7kuFAVAMH1YfXwGFhFt89_VrMqUV0hC0Y5prvM3Ep6FYnWMPLabZahk3tkPvXdJJ85vqhY7DlGtIOf0wn9bLpa4_uav0kM3W8LeOH9JFGCy1WFRvuju9IQSyA9_4oi2ea49doPVD3YBeXhUaH2e6mapphD8VEDtVX9erjXNMTnpJ80fBuSnlNmF4Mr1uzQXTi8fDvCr4mamrZsoB1ScEw7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HvGSO9asJymrsjPhZIPhLVZcRysJf3vPCp8mrYHnt8OJZhqDGTe_d-1ARla_-1-HmPLlKydDeVMVaxWf0uB15Stee5tbCFy_LOL8n_8sI8jetH5fUd41lBIFmxrHiz6LLsNT7oGmwgrhtq-bj82cY3qdFD1KK4Lgw4mIBPYpZ18xe08eo6jPW9W0w-M-gChSk_455ZCmLYKSb10elci6emOq2bhLpRho9JlcoaLtxUPuOsJlda3AHLahfcN7LzywN6YhiGIKHLMXykcBEFB8AgsedxYcc83vzhRGI3-ov1fU3-OUl61d68Ssl4m8Aix_24f1bZINXIZxVxcvjaHRYP92vSu1eP1B99N3-6nGi0ZqFkniVTEaHF2Pn_zezWldB0OJpbHTGhCIoZkqSU4I0iPkHSX1QxIyjGHfy9evXfwErYp4O.ZySbdA.IOzQ4B0k8HNh-01pbYKqF3sN8jI
|
||||
|
||||
Upgrade-Insecure-Requests: 1
|
||||
|
||||
Sec-Fetch-Dest: document
|
||||
|
||||
Sec-Fetch-Mode: navigate
|
||||
|
||||
Sec-Fetch-Site: same-origin
|
||||
|
||||
Sec-Fetch-User: ?1
|
||||
|
||||
Sec-Gpc: 1
|
||||
|
||||
Priority: u=0, i
|
||||
|
||||
|
||||
|
||||
|
||||
Request data: b''
|
||||
Traceback: Traceback (most recent call last):
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 880, in full_dispatch_request
|
||||
rv = self.dispatch_request()
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\app.py", line 865, in dispatch_request
|
||||
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\controllers\store\manufacturing_purchase_order.py", line 43, in manufacturing_purchase_orders
|
||||
return render_template('pages/store/_manufacturing_purchase_orders.html', model = model, datetime = datetime)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 150, in render_template
|
||||
return _render(app, template, context)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask\templating.py", line 131, in _render
|
||||
rv = template.render(context)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 1304, in render
|
||||
self.environment.handle_exception()
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 939, in handle_exception
|
||||
raise rewrite_traceback_stack(source=source)
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_manufacturing_purchase_orders.html", line 1, in top-level template code
|
||||
{% extends 'layouts/layout.html' %}
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\layouts\layout.html", line 354, in top-level template code
|
||||
{% block page_body %}{% endblock %}
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\pages\store\_manufacturing_purchase_orders.html", line 62, in block 'page_body'
|
||||
{% include 'components/store/_row_manufacturing_purchase_order.html' %}
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\OneDrive\Documents\Programming\Visual Studio 2022\PARTS_Web\app\templates\components\store\_row_manufacturing_purchase_order.html", line 40, in top-level template code
|
||||
<tr class="{{ model.FLAG_MANUFACTURING_PURCHASE_ORDER }}" {{ model.ATTR_ID_MANUFACTURING_PURCHASE_ORDER }}="{{ order.id_order }}">
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
File "C:\Users\edwar\AppData\Local\Programs\Python\Python312\Lib\site-packages\jinja2\environment.py", line 487, in getattr
|
||||
return getattr(obj, attribute)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
jinja2.exceptions.UndefinedError: 'order' is undefined
|
||||
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: development
|
||||
config_env: production
|
||||
config_env: production
|
||||
Server Error: (MySQLdb.OperationalError) (1054, "Unknown column 'v_id_permission_manufacturing' in 'where clause'")
|
||||
[SQL: CALL p_shop_get_many_manufacturing_purchase_order(%s, %s, %s, %s, %s, %s, %s, %s)]
|
||||
[parameters: (0, True, True, '', '', None, None, 0)]
|
||||
(Background on this error at: https://sqlalche.me/e/20/e3q8)
|
||||
6
app.py
6
app.py
@@ -96,10 +96,12 @@ def internal_server_error(error):
|
||||
app.logger.error('Traceback: %s', traceback.format_exc())
|
||||
return "Internal Server Error", 500
|
||||
|
||||
@app.before_request
|
||||
def make_session_permanent():
|
||||
session.permanent = True
|
||||
|
||||
|
||||
"""
|
||||
csrf = CSRFProtect()
|
||||
"""
|
||||
cors = CORS()
|
||||
db = SQLAlchemy()
|
||||
mail = Mail()
|
||||
|
||||
15
config.py
15
config.py
@@ -32,6 +32,15 @@ class Config:
|
||||
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
# Auth0
|
||||
SESSION_COOKIE_SECURE = True
|
||||
SESSION_COOKIE_HTTPONLY = True
|
||||
# SESSION_COOKIE_SAMESITE = 'Lax'
|
||||
# PERMANENT_SESSION_LIFETIME = 3600
|
||||
WTF_CSRF_ENABLED = True
|
||||
# WTF_CSRF_CHECK_DEFAULT = False # We'll check it manually for API routes
|
||||
# WTF_CSRF_HEADERS = ['X-CSRFToken'] # Accept CSRF token from this header
|
||||
WTF_CSRF_TIME_LIMIT = None
|
||||
WTF_CSRF_SSL_STRICT = False # Allows testing without HTTPS
|
||||
ID_AUTH0_CLIENT = os.getenv('ID_AUTH0_CLIENT')
|
||||
ID_AUTH0_CLIENT_SECRET = os.getenv('ID_AUTH0_CLIENT_SECRET')
|
||||
DOMAIN_AUTH0 = os.getenv('DOMAIN_AUTH0')
|
||||
@@ -71,9 +80,10 @@ class Config:
|
||||
|
||||
class DevelopmentConfig(Config):
|
||||
is_development = True
|
||||
# Add development-specific configuration variables
|
||||
DEBUG = True
|
||||
MAIL_DEBUG = True
|
||||
# Add development-specific configuration variables
|
||||
SESSION_COOKIE_SECURE = False
|
||||
|
||||
class ProductionConfig(Config):
|
||||
is_production = True
|
||||
@@ -82,8 +92,9 @@ class ProductionConfig(Config):
|
||||
|
||||
# Set the configuration class based on the environment
|
||||
# You can change 'development' to 'production' when deploying
|
||||
config_env = os.getenv('FLASK_ENV', "production")
|
||||
config_env = os.getenv('FLASK_ENV', "development")
|
||||
with open('app.log', 'a') as f:
|
||||
print(f'config_env: {config_env}')
|
||||
f.write(f'config_env: {config_env}\n')
|
||||
# current_app.logger.error(f'config_env: {config_env}') # logger not yet initialised
|
||||
if config_env == 'development':
|
||||
|
||||
Binary file not shown.
@@ -21,52 +21,92 @@ import lib.argument_validation as av
|
||||
# external
|
||||
from flask import Flask, render_template, jsonify, request, render_template_string, send_from_directory, redirect, url_for, session, Blueprint, current_app
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
from flask_wtf.csrf import generate_csrf
|
||||
from werkzeug.exceptions import BadRequest
|
||||
from extensions import oauth # db,
|
||||
from urllib.parse import quote_plus, urlencode
|
||||
from authlib.integrations.flask_client import OAuth
|
||||
from authlib.integrations.base_client import OAuthError
|
||||
from urllib.parse import quote, urlparse, parse_qs
|
||||
from functools import wraps
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
routes_user = Blueprint('routes_user', __name__)
|
||||
|
||||
# User authentication
|
||||
@routes_user.route("/login", methods=['POST'])
|
||||
@routes_user.route("/login", methods=['POST', 'OPTIONS'])
|
||||
def login():
|
||||
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:
|
||||
data = request.get_json()
|
||||
except:
|
||||
data = {}
|
||||
except:
|
||||
data = {}
|
||||
Helper_App.console_log(f'data={data}')
|
||||
# callback_login = F'{Model_View_Base.HASH_CALLBACK_LOGIN}{data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME)}'
|
||||
|
||||
# encoded_path = quote(data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME))
|
||||
uri_redirect = url_for('routes_user.login_callback', _external=True) # , subpath=encoded_path
|
||||
|
||||
# uri_redirect = f'{current_app.URL_HOST}/login_callback?subpath={data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME)}'
|
||||
Helper_App.console_log(f'redirect uri: {uri_redirect}')
|
||||
hash_callback = data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME)
|
||||
Helper_App.console_log(f'hash_callback: {hash_callback}')
|
||||
|
||||
red = oauth.auth0.authorize_redirect(
|
||||
redirect_uri = uri_redirect,
|
||||
state = quote(hash_callback)
|
||||
)
|
||||
Helper_App.console_log(f'redirect: {red}')
|
||||
headers = red.headers['Location']
|
||||
Helper_App.console_log(f'headers: {headers}')
|
||||
parsed_url = urlparse(headers)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
Helper_App.console_log(f"""
|
||||
OAuth Authorize Redirect URL:
|
||||
"""
|
||||
# Verify CSRF token manually
|
||||
Helper_App.console_log(f'request headers={request.headers}')
|
||||
token = request.headers.get(Model_View_Base.FLAG_CSRF_TOKEN)
|
||||
Helper_App.console_log(f'token={token}')
|
||||
Helper_App.console_log(f'session={session}')
|
||||
Helper_App.console_log(f'session token={session.get('csrf_token')}')
|
||||
if not token or token != session.get('csrf_token'):
|
||||
token = data.get(Model_View_Base.FLAG_CSRF_TOKEN, None)
|
||||
Helper_App.console_log(f'token={token}')
|
||||
if not token or token != session.get('csrf_token'):
|
||||
raise BadRequest('Invalid or missing CSRF token')
|
||||
"""
|
||||
# OAuth login
|
||||
try:
|
||||
# callback_login = F'{Model_View_Base.HASH_CALLBACK_LOGIN}{data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME)}'
|
||||
|
||||
# encoded_path = quote(data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME))
|
||||
uri_redirect = url_for('routes_user.login_callback', _external=True) # , subpath=encoded_path
|
||||
|
||||
# uri_redirect = f'{current_app.URL_HOST}/login_callback?subpath={data.get(Model_View_Base.FLAG_CALLBACK, Model_View_Base.HASH_PAGE_HOME)}'
|
||||
Helper_App.console_log(f'redirect uri: {uri_redirect}')
|
||||
|
||||
Helper_App.console_log(f'Before red')
|
||||
|
||||
red = oauth.auth0.authorize_redirect(
|
||||
redirect_uri = uri_redirect,
|
||||
state = quote(hash_callback)
|
||||
)
|
||||
Helper_App.console_log(f'redirect: {red}')
|
||||
headers = red.headers['Location']
|
||||
Helper_App.console_log(f'headers: {headers}')
|
||||
parsed_url = urlparse(headers)
|
||||
query_params = parse_qs(parsed_url.query)
|
||||
Helper_App.console_log(f"""
|
||||
OAuth Authorize Redirect URL:
|
||||
|
||||
Base URL: {parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path}
|
||||
{parsed_url}
|
||||
|
||||
Query Parameters: {query_params}
|
||||
""")
|
||||
return jsonify({'Success': True, Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_SUCCESS, f'{Model_View_Base.FLAG_CALLBACK}': headers})
|
||||
|
||||
return jsonify({'status': 'success', 'redirect': callback})
|
||||
except Exception as e:
|
||||
return jsonify({'status': 'error', 'message': str(e)}), 400
|
||||
|
||||
Base URL: {parsed_url.scheme}://{parsed_url.netloc}{parsed_url.path}
|
||||
{parsed_url}
|
||||
|
||||
Query Parameters: {query_params}
|
||||
""")
|
||||
return jsonify({'Success': True, Model_View_Base.FLAG_STATUS: Model_View_Base.FLAG_SUCCESS, f'{Model_View_Base.FLAG_CALLBACK}': headers})
|
||||
|
||||
@routes_user.route("/login_callback") # <path:subpath>/<code>
|
||||
def login_callback():
|
||||
|
||||
Binary file not shown.
@@ -71,6 +71,7 @@ class Model_View_Base(BaseModel, ABC):
|
||||
FLAG_CONTAINER_ICON_AND_LABEL: ClassVar[str] = 'container-icon-label'
|
||||
FLAG_CONTAINER_INPUT: ClassVar[str] = FLAG_CONTAINER + '-input'
|
||||
FLAG_COUNTY: ClassVar[str] = Base.FLAG_COUNTY
|
||||
FLAG_CSRF_TOKEN: ClassVar[str] = 'X-CSRFToken'
|
||||
FLAG_CURRENCY: ClassVar[str] = 'currency'
|
||||
FLAG_DATA: ClassVar[str] = 'data'
|
||||
FLAG_DATE_FROM: ClassVar[str] = Base.FLAG_DATE_FROM
|
||||
|
||||
44
static/dist/js/main.bundle.js
vendored
44
static/dist/js/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -4,21 +4,25 @@ import DOM from './dom.js';
|
||||
export default class API {
|
||||
|
||||
static getCsrfToken() {
|
||||
// return document.querySelectorAll('meta[name=' + nameCSRFToken + ']').getAttribute('content');
|
||||
return document.querySelector(idCSRFToken).getAttribute('content');
|
||||
}
|
||||
|
||||
static async request(hashEndpoint, method = 'GET', data = null, params = null) {
|
||||
const url = API.getUrlFromHash(hashEndpoint, params);
|
||||
const csrfToken = API.getCsrfToken();
|
||||
const options = {
|
||||
method,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-CSRFToken': API.getCsrfToken()
|
||||
[flagCsrfToken]: csrfToken,
|
||||
}
|
||||
};
|
||||
|
||||
if (data && (method === 'POST' || method === 'PUT' || method === 'PATCH')) {
|
||||
data = {
|
||||
...data,
|
||||
[flagCsrfToken]: csrfToken,
|
||||
};
|
||||
options.body = JSON.stringify(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
</script>
|
||||
<meta name="yandex-verification" content="4693a824cfda082a" />
|
||||
<meta id="{{ model.ID_CSRF_TOKEN }}" name="{{ model.NAME_CSRF_TOKEN }}" content="{{ csrf_token() }}" />
|
||||
<meta id="{{ model.ID_CSRF_TOKEN }}" name="{{ model.FLAG_CSRF_TOKEN }}" content="{{ csrf_token() }}" />
|
||||
|
||||
<!-- Scripts
|
||||
<script src="{{ url_for('static', filename='js/lib/common.js') }}"></script>
|
||||
@@ -98,6 +98,7 @@
|
||||
var flagContainer = "{{ model.FLAG_CONTAINER }}";
|
||||
var flagContainerInput = "{{ model.FLAG_CONTAINER_INPUT }}";
|
||||
var flagCounty = "{{ model.FLAG_COUNTY }}";
|
||||
var flagCsrfToken = "{{ model.FLAG_CSRF_TOKEN }}";
|
||||
var flagCurrency = "{{ model.FLAG_CURRENCY }}";
|
||||
var flagDelete = "{{ model.FLAG_DELETE }}";
|
||||
var flagDescription = "{{ model.FLAG_DESCRIPTION }}";
|
||||
@@ -233,7 +234,6 @@
|
||||
var idTableMain = "#{{ model.ID_TABLE_MAIN }}";
|
||||
var idTextareaConfirm = "#{{ model.ID_TEXTAREA_CONFIRM }}";
|
||||
var isUserLoggedIn = "{{ model.output_bool(model.IS_USER_LOGGED_IN) }}";
|
||||
var nameCSRFToken = "{{ model.NAME_CSRF_TOKEN }}";
|
||||
var _pathHost = "{{ model.get_url_host() }}";
|
||||
var _rowBlank = null;
|
||||
var titlePageCurrent = "{{ model.title }}";
|
||||
|
||||
Reference in New Issue
Block a user