myproduct_data[0]['product_uid']
This commit is contained in:
@@ -852,12 +852,45 @@ def subscription_start(current_user):
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(INSERT_NEW_PRODUCT,val_insert)
|
||||
|
||||
print(product_id)
|
||||
SELECT_LAST_ENTRY = f"SELECT id, uid AS product_uid FROM members_products WHERE internal_url='{internal_url}'"
|
||||
|
||||
print(SELECT_LAST_ENTRY)
|
||||
with connection:
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(SELECT_LAST_ENTRY)
|
||||
select_pendingRes = cursor.fetchall()
|
||||
|
||||
myproduct_data = []
|
||||
print(select_pendingRes)
|
||||
myproduct_data = json.dumps( [dict(ix) for ix in select_pendingRes] )
|
||||
print(myproduct_data)
|
||||
|
||||
print(myproduct_data[0]['product_uid'])
|
||||
addProvisionAction(member_id,myproduct_data[0]['product_uid'],'Started initial provision - '+ internal_url)
|
||||
# myproduct_data = []
|
||||
return jsonify(myproduct_data=myproduct_data)
|
||||
|
||||
def addProvisionAction(member_id,product_uid,action):
|
||||
INSERT_NEW_ACTION ="INSERT INTO provision_actions (member_id ,product_uid) VALUES (%s, %s, %s)"
|
||||
val_insert = (member_id,product_uid,action)
|
||||
with connection:
|
||||
with connection.cursor(cursor_factory=psycopg2.extras.DictCursor) as cursor:
|
||||
cursor.execute(INSERT_NEW_ACTION,val_insert)
|
||||
|
||||
# pass
|
||||
|
||||
#
|
||||
# CREATE TABLE provision_actions (
|
||||
# id SERIAL,
|
||||
# uid uuid DEFAULT uuid_generate_v4(),
|
||||
# member_id INT REFERENCES members(id),
|
||||
# product_uid VARCHAR(100) NOT NULL,
|
||||
# action VARCHAR(100) NOT NULL,
|
||||
# added timestamp without time zone DEFAULT now()
|
||||
# );
|
||||
# ALTER TABLE ONLY provision_actions
|
||||
# ADD CONSTRAINT provision_actions_id_key UNIQUE (id);
|
||||
#
|
||||
|
||||
@app.route("/panel/settings")
|
||||
def user_settings():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user