From d8f678982336287bddec664be535585dce2e501c Mon Sep 17 00:00:00 2001
From: nart4hire <13520129@std.stei.itb.ac.id>
Date: Thu, 4 May 2023 03:28:54 +0700
Subject: [PATCH] Update 20230314062152-course-flavor.sql

---
 migrations/development/20230314062152-course-flavor.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migrations/development/20230314062152-course-flavor.sql b/migrations/development/20230314062152-course-flavor.sql
index 5f7275e..85bfe50 100644
--- a/migrations/development/20230314062152-course-flavor.sql
+++ b/migrations/development/20230314062152-course-flavor.sql
@@ -15,7 +15,7 @@ CREATE OR REPLACE FUNCTION assign_lecturer()
 RETURNS TRIGGER
 AS $assign$
 BEGIN
-  IF NEW.lecturer is NULL THEN
+  IF NEW.lecturer is NULL OR NEW.lecturer = '' THEN
     NEW.lecturer = (SELECT name FROM public."user" WHERE email = NEW.email);
   END IF;
   RETURN NEW;
-- 
GitLab