Skip to content
Snippets Groups Projects
Commit e29e3f66 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Handling NULL weather station info in forecast configuration

parent 719364f7
Branches
No related tags found
No related merge requests found
...@@ -229,6 +229,15 @@ class ForecastConfiguration: ...@@ -229,6 +229,15 @@ class ForecastConfiguration:
for crop_organism_id in crop_organism_ids: for crop_organism_id in crop_organism_ids:
crop_organism_id_paramstring += "&cropOrganismId=%s" % crop_organism_id crop_organism_id_paramstring += "&cropOrganismId=%s" % crop_organism_id
print "%s://%s/rest/organizationforecastconfigurations/%s?from=%s-01-01&to=%s-12-31%s" % (
settings.VIPSLOGIC_PROTOCOL,
settings.VIPSLOGIC_SERVER_NAME,
settings.VIPS_ORGANIZATION_ID,
season,
season,
crop_organism_id_paramstring
)
request_result = requests.get("%s://%s/rest/organizationforecastconfigurations/%s?from=%s-01-01&to=%s-12-31%s" % ( request_result = requests.get("%s://%s/rest/organizationforecastconfigurations/%s?from=%s-01-01&to=%s-12-31%s" % (
settings.VIPSLOGIC_PROTOCOL, settings.VIPSLOGIC_PROTOCOL,
settings.VIPSLOGIC_SERVER_NAME, settings.VIPSLOGIC_SERVER_NAME,
...@@ -527,7 +536,3 @@ class ModelGraphParameter(models.Model): ...@@ -527,7 +536,3 @@ class ModelGraphParameter(models.Model):
def __unicode__(self): def __unicode__(self):
return self.model_id + "/" + self.resultparameter.getNamespaceKey() return self.model_id + "/" + self.resultparameter.getNamespaceKey()
...@@ -45,8 +45,8 @@ Organism.prototype.getLocalName = function(languageCode) ...@@ -45,8 +45,8 @@ Organism.prototype.getLocalName = function(languageCode)
var PointOfInterest = function(pJSON) var PointOfInterest = function(pJSON)
{ {
this.pointOfInterestId = pJSON.pointOfInterestId; this.pointOfInterestId = pJSON != null ? pJSON.pointOfInterestId : -1;
this.name = pJSON.name; this.name = pJSON != null ? pJSON.name : "";
}; };
// Defining the forecast configuration object // Defining the forecast configuration object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment