This is an automated email from the ASF dual-hosted git repository.

yasithdev pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airavata-portals.git


The following commit(s) were added to refs/heads/main by this push:
     new 57d519a13 Don't fetch a parser on the data-parser create page (#224)
57d519a13 is described below

commit 57d519a139ce2c44e15b223fbaef660237ad5b0b
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sun Jun 14 00:19:50 2026 -0400

    Don't fetch a parser on the data-parser create page (#224)
    
    * fix(auth): return a clean response when settings_local download is 
blocked in DEBUG
    
    download_settings_local raised a bare Exception in DEBUG mode, which Django
    renders as an unhandled 500 + stack trace. Return HttpResponseBadRequest 
with the
    same message so the intentional restriction degrades to a graceful 400.
    
    * fix(dataparsers): don't fetch a parser on the create page
    
    ParserEditContainer.mounted() always called ParserService.retrieve(), but 
the
    create page mounts it with no parserId (null), so it requested a null id 
and the
    server returned "No Parser Info entry exists for null". Fetch only when a
    parserId is present; otherwise start from an empty Parser so the editor 
renders
    for a new parser.
---
 .../js/containers/ParserEditContainer.vue                | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git 
a/airavata-django-portal/django_airavata/apps/dataparsers/static/django_airavata_dataparsers/js/containers/ParserEditContainer.vue
 
b/airavata-django-portal/django_airavata/apps/dataparsers/static/django_airavata_dataparsers/js/containers/ParserEditContainer.vue
index d520d1527..9bf8f5ab6 100644
--- 
a/airavata-django-portal/django_airavata/apps/dataparsers/static/django_airavata_dataparsers/js/containers/ParserEditContainer.vue
+++ 
b/airavata-django-portal/django_airavata/apps/dataparsers/static/django_airavata_dataparsers/js/containers/ParserEditContainer.vue
@@ -10,14 +10,14 @@
 <script>
 import ParserEditor from "../parser-components/ParserEditor.vue";
 
-import { services } from "django-airavata-api";
+import { models, services } from "django-airavata-api";
 
 export default {
   name: "parser-edit-container",
   props: {
     parserId: {
       type: String,
-      required: true,
+      default: null,
     },
   },
   data() {
@@ -38,9 +38,15 @@ export default {
   },
   computed: {},
   mounted: function () {
-    services.ParserService.retrieve({ lookup: this.parserId }).then(
-      (parser) => (this.parser = parser)
-    );
+    // No parserId means this is the "create parser" page: start from an empty
+    // parser instead of fetching (retrieving a null id errors server-side).
+    if (this.parserId) {
+      services.ParserService.retrieve({ lookup: this.parserId }).then(
+        (parser) => (this.parser = parser)
+      );
+    } else {
+      this.parser = new models.Parser();
+    }
   },
 };
 </script>

Reply via email to