org-link fix: INSERT bound 4 values to 3 placeholders (500 on every link); slug = org slug
This commit is contained in:
1 parent
d8d80d9594
commit
e24c272e2e
1 file changed
+4
-1
+4
-1
@@ -2476,10 +2476,13 @@ async def admin_org_link(request: Request):
|
||||
|
||||
conn = get_db()
|
||||
existing = conn.execute("SELECT email FROM members WHERE org_slug = ?", (org_slug,)).fetchone()
|
||||
# slug = the org slug (this row represents the org's contact, not an OC
|
||||
# individual — provision_member() overwrites slug/cloudron_user_id/key for
|
||||
# emails that resolve to a real OC account).
|
||||
conn.execute(
|
||||
"INSERT INTO members (email, slug, active, org_slug) VALUES (?, ?, 1, ?) "
|
||||
"ON CONFLICT(email) DO UPDATE SET org_slug = excluded.org_slug, active = 1",
|
||||
(email, name, org_slug, org_slug),
|
||||
(email, org_slug, org_slug),
|
||||
)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
Reference in new issue
Block a user