Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasmllr committed Dec 20, 2024
2 parents 12487ae + 9b8f9ac commit 0d571f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/rctool/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,12 @@ def rctool_develop_initialize(request):
import_form = import_rc_data(request.POST, request.FILES)
session_content = request.POST.get("session_content")

df = pd.read_json(io.StringIO(session_content))
try:
df = pd.read_json(io.StringIO(session_content))
except Exception as e:
messages.error(request, "Error: session file could not be parsed.")
return render(request, "rctool/rctool/import/rctool_import.html", context)


# preprocess data from previous session
data_raw_lst = df["data"].values.tolist()
Expand Down Expand Up @@ -428,7 +433,7 @@ def rctool_develop_initialize(request):
try:
field_df_raw = pd.read_json(io.StringIO(field_data_json))
except Exception as e:
messages.error(request, "Error: CSV file is could not be parsed.")
messages.error(request, "Error: CSV file could not be parsed.")
return render(request, "rctool/rctool/import/rctool_import.html", context)

# convert first row to lower case
Expand Down

0 comments on commit 0d571f6

Please sign in to comment.