From c88d0c205126da06e5fb0de399360fde85e3b05c Mon Sep 17 00:00:00 2001
From: prichier <pascoualito@gmail.com>
Date: Sat, 27 Jun 2020 02:15:20 +0200
Subject: [PATCH] Fix sql command to avoid import already linked profiles in
 Writefreely DB

---
 hiboo/application/templates/application_writefreely.html | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hiboo/application/templates/application_writefreely.html b/hiboo/application/templates/application_writefreely.html
index 2c11fad..0a725ab 100644
--- a/hiboo/application/templates/application_writefreely.html
+++ b/hiboo/application/templates/application_writefreely.html
@@ -61,6 +61,12 @@ auth_endpoint      = {{ url_for("sso.oidc_authorize", service_uuid=service.uuid,
     left join
         users wf
     ON h.profile_name = wf.username
+    where NOT EXISTS
+        (
+        SELECT  1
+        FROM    oauth_users oau
+        WHERE   wf.id = oau.user_id
+        );
 
     drop table tmp_hiboo;
 
-- 
GitLab