fix
authorRadek Czajka <rczajka@rczajka.pl>
Fri, 23 Sep 2022 13:47:57 +0000 (15:47 +0200)
committerRadek Czajka <rczajka@rczajka.pl>
Fri, 23 Sep 2022 13:47:57 +0000 (15:47 +0200)
src/catalogue/static/catalogue/wikidata_admin.js

index 2ba5a1c..a8aa51e 100644 (file)
@@ -8,6 +8,7 @@
             $(".wikidata-hint").remove();
             $wdinput = $(this);
             let qid = $wdinput.val();
             $(".wikidata-hint").remove();
             $wdinput = $(this);
             let qid = $wdinput.val();
+            if (!qid) return;
             $wdinput.addClass('wikidata-processing');
             $.ajax(
                 '/catalogue/wikidata/' + model + '/' + qid,
             $wdinput.addClass('wikidata-processing');
             $.ajax(
                 '/catalogue/wikidata/' + model + '/' + qid,
@@ -39,6 +40,8 @@
                             }
                         };
 
                             }
                         };
 
+                    },
+                    complete: function() {
                         $wdinput.removeClass('wikidata-processing');
                     },
                 }
                         $wdinput.removeClass('wikidata-processing');
                     },
                 }