Skip to content

Commit

Permalink
Merge pull request open-plan-tool#267 from open-plan-tool/fix/sig-utf
Browse files Browse the repository at this point in the history
Fix timeseries parsing error
  • Loading branch information
Bachibouzouk authored Apr 24, 2024
2 parents d5375ea + b7768b0 commit 179f830
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion app/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,11 @@ def clean_input_timeseries(self):
except TypeError as e:
raise ValidationError(str(e))
except Exception as ex:
raise ValidationError(_("Could not parse a file. Did you upload one?"))
raise ValidationError(
_(
f"Could not parse a file due to the following error: {ex}. Did you upload a file?"
)
)

def clean_efficiency_multiple(self):
data = self.cleaned_data["efficiency_multiple"]
Expand Down
2 changes: 1 addition & 1 deletion app/projects/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def parse_input_timeseries(timeseries_file):
pass

else:
timeseries_file_str = timeseries_file.read().decode("utf-8")
timeseries_file_str = timeseries_file.read().decode("utf-8-sig")

if timeseries_file_str != "":
if timeseries_file.name.endswith("json"):
Expand Down
4 changes: 3 additions & 1 deletion app/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def signup(request):
send_email_exchange(to_email=to_email, subject=subject, message=message)
messages.info(
request,
_("Please confirm your email address to complete the registration"),
_(
"Please confirm your email address to complete the registration (note that the registration email may land in your spam box, if your email provider does not trust our domain name, we have unfortunately no control on our users' email provider)"
),
)
return redirect("home")
else:
Expand Down

0 comments on commit 179f830

Please sign in to comment.