Skip to content

Commit

Permalink
Remove 'id' field from authentication_maiaproject appends in dashboar…
Browse files Browse the repository at this point in the history
…d_utils.py
  • Loading branch information
SimoneBendazzoli93 committed Feb 4, 2025
1 parent 4207d4c commit 8bcd771
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions MAIA/dashboard_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def register_cluster_for_project_in_db(settings, namespace, cluster):
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "cluster"] = cluster
except:
id = 0 if pd.isna(authentication_maiaproject["id"].max()) else authentication_maiaproject["id"].max() + 1
authentication_maiaproject = authentication_maiaproject.append({"id": id, "namespace": group_id, "cluster": cluster, "memory_limit": "2 Gi", "cpu_limit": "2"}, ignore_index=True)
authentication_maiaproject = authentication_maiaproject.append({"namespace": group_id, "cluster": cluster, "memory_limit": "2 Gi", "cpu_limit": "2"}, ignore_index=True)


cnx.close()
Expand Down Expand Up @@ -914,7 +914,7 @@ def update_user_table(form, settings):
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "memory_limit"] = form[k]
else:

authentication_maiaproject = authentication_maiaproject.append({"id": id, "memory_limit": form[k],"namespace": k[len("memory_limit_"):]},
authentication_maiaproject = authentication_maiaproject.append({"memory_limit": form[k],"namespace": k[len("memory_limit_"):]},
ignore_index=True)
elif k.startswith("cpu_limit"):
try:
Expand All @@ -925,7 +925,7 @@ def update_user_table(form, settings):
if len(authentication_maiaproject[authentication_maiaproject["id"] == id]) > 0:
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "cpu_limit"] = form[k]
else:
authentication_maiaproject = authentication_maiaproject.append({"id": id, "cpu_limit": form[k],"namespace": k[len("cpu_limit_"):]},
authentication_maiaproject = authentication_maiaproject.append({"cpu_limit": form[k],"namespace": k[len("cpu_limit_"):]},
ignore_index=True)
elif k.startswith("date"):
try:
Expand All @@ -936,7 +936,7 @@ def update_user_table(form, settings):
if len(authentication_maiaproject[authentication_maiaproject["id"] == id]) > 0:
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "date"] = form[k]
else:
authentication_maiaproject = authentication_maiaproject.append({"id": id, "date": form[k],"namespace": k[len("date_"):]},
authentication_maiaproject = authentication_maiaproject.append({ "date": form[k],"namespace": k[len("date_"):]},
ignore_index=True)
elif k.startswith("cluster"):
try:
Expand All @@ -947,7 +947,7 @@ def update_user_table(form, settings):
if len(authentication_maiaproject[authentication_maiaproject["id"] == id]) > 0:
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "cluster"] = form[k]
else:
authentication_maiaproject = authentication_maiaproject.append({"id": id, "cluster": form[k],"namespace": k[len("cluster_"):]},
authentication_maiaproject = authentication_maiaproject.append({ "cluster": form[k],"namespace": k[len("cluster_"):]},
ignore_index=True)
elif k.startswith("gpu"):
try:
Expand All @@ -960,7 +960,7 @@ def update_user_table(form, settings):
if len(authentication_maiaproject[authentication_maiaproject["id"] == id]) > 0:
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "gpu"] = form[k]
else:
authentication_maiaproject = authentication_maiaproject.append({"id": id, "gpu": form[k],"namespace": k[len("gpu_"):]},
authentication_maiaproject = authentication_maiaproject.append({ "gpu": form[k],"namespace": k[len("gpu_"):]},
ignore_index=True)
elif k.startswith("minimal_environment"):
try:
Expand All @@ -971,7 +971,7 @@ def update_user_table(form, settings):
if len(authentication_maiaproject[authentication_maiaproject["id"] == id]) > 0:
authentication_maiaproject.loc[authentication_maiaproject["id"] == id, "minimal_env"] = form[k]
else:
authentication_maiaproject = authentication_maiaproject.append({"id": id, "minimal_env": form[k],"namespace": k[len("minimal_environment_"):]},
authentication_maiaproject = authentication_maiaproject.append({ "minimal_env": form[k],"namespace": k[len("minimal_environment_"):]},
ignore_index=True)


Expand Down

0 comments on commit 8bcd771

Please sign in to comment.