Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ private List<FormValidationError> validateConstraints(Site site) {
if (site.getLocation() == null)
errors.add(new FormValidationError("Site", "locationId", "", "Please select a location."));

if (site.getLatitude() == null)
errors.add(new FormValidationError("Site", "latitude", "", "Latitude is required."));
else if (site.getLatitude() <= -90.0 || site.getLatitude() >= 90.0)
errors.add(new FormValidationError("Site", "latitude", site.getLatitude().toString(), "Latitude must be between -90.0 and 90.0."));

if (site.getLongitude() == null)
errors.add(new FormValidationError("Site", "longitude", "", "Longitude is required."));
else if (site.getLongitude() <= -180.0 || site.getLongitude() >= 180.0)
errors.add(new FormValidationError("Site", "longitude", site.getLongitude().toString(), "Longitude must be between -180.0 and 180.0."));

if (errors.size() > 0)
return errors;

Expand Down
Loading