prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Project editor crash for conditions without a text
  ## Test plan
  1. Open the project editor, and click the 'Show advanced IATI fields' button
  2. In the results and indicators section, add a project condition with only a type (no condition text)
  3. Save
  4. Refresh the page
  5. **RESULT:** No error should be shown and the condition should state "No condition specified"
  ## Issue description
  
  Hasn't happened on Live yet, but it did on Test. See http://sentry.support.akvo-ops.org/rsr/test/group/690/.
  
  
  </issue>
  <code>
  [start of akvo/rsr/models/project_condition.py]
  1 # -*- coding: utf-8 -*-
  2 
  3 # Akvo RSR is covered by the GNU Affero General Public License.
  4 # See more details in the license.txt file located at the root folder of the Akvo RSR module.
  5 # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
  6 
  7 
  8 from django.db import models
  9 from django.utils.translation import ugettext_lazy as _
  10 
  11 from ..fields import ValidXMLCharField
  12 
  13 from akvo.codelists.models import ConditionType
  14 from akvo.codelists.store.codelists_v201 import CONDITION_TYPE
  15 from akvo.utils import codelist_choices, codelist_value
  16 
  17 
  18 class ProjectCondition(models.Model):
  19     project = models.ForeignKey('Project', verbose_name=_(u'project'), related_name='conditions')
  20     text = ValidXMLCharField(_(u'condition'), blank=True, max_length=100,
  21                              help_text=_(u'(100 characters)'))
  22     type = ValidXMLCharField(_(u'condition type'), blank=True, max_length=1,
  23                              choices=codelist_choices(CONDITION_TYPE))
  24 
  25     def __unicode__(self):
  26         return self.text if self.text else _(u'No condition specified')
  27 
  28     def iati_type(self):
  29         return codelist_value(ConditionType, self, 'type')
  30 
  31     class Meta:
  32         app_label = 'rsr'
  33         verbose_name = _(u'condition')
  34         verbose_name_plural = _(u'conditions')
  35
  [end of akvo/rsr/models/project_condition.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/akvo/rsr/models/project_condition.py b/akvo/rsr/models/project_condition.py
  --- a/akvo/rsr/models/project_condition.py
  +++ b/akvo/rsr/models/project_condition.py
  @@ -23,7 +23,7 @@
                                choices=codelist_choices(CONDITION_TYPE))
   
       def __unicode__(self):
  -        return self.text if self.text else _(u'No condition specified')
  +        return self.text if self.text else u'%s' % _(u'No condition specified')
   
       def iati_type(self):
           return codelist_value(ConditionType, self, 'type')
  
verification_info: {"golden_diff": "diff --git a/akvo/rsr/models/project_condition.py b/akvo/rsr/models/project_condition.py\n--- a/akvo/rsr/models/project_condition.py\n+++ b/akvo/rsr/models/project_condition.py\n@@ -23,7 +23,7 @@\n                              choices=codelist_choices(CONDITION_TYPE))\n \n     def __unicode__(self):\n-        return self.text if self.text else _(u'No condition specified')\n+        return self.text if self.text else u'%s' % _(u'No condition specified')\n \n     def iati_type(self):\n         return codelist_value(ConditionType, self, 'type')\n", "issue": "Project editor crash for conditions without a text\n## Test plan\n1. Open the project editor, and click the 'Show advanced IATI fields' button\n2. In the results and indicators section, add a project condition with only a type (no condition text)\n3. Save\n4. Refresh the page\n5. **RESULT:** No error should be shown and the condition should state \"No condition specified\"\n## Issue description\n\nHasn't happened on Live yet, but it did on Test. See http://sentry.support.akvo-ops.org/rsr/test/group/690/.\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\n# Akvo RSR is covered by the GNU Affero General Public License.\n# See more details in the license.txt file located at the root folder of the Akvo RSR module.\n# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.\n\n\nfrom django.db import models\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom ..fields import ValidXMLCharField\n\nfrom akvo.codelists.models import ConditionType\nfrom akvo.codelists.store.codelists_v201 import CONDITION_TYPE\nfrom akvo.utils import codelist_choices, codelist_value\n\n\nclass ProjectCondition(models.Model):\n    project = models.ForeignKey('Project', verbose_name=_(u'project'), related_name='conditions')\n    text = ValidXMLCharField(_(u'condition'), blank=True, max_length=100,\n                             help_text=_(u'(100 characters)'))\n    type = ValidXMLCharField(_(u'condition type'), blank=True, max_length=1,\n                             choices=codelist_choices(CONDITION_TYPE))\n\n    def __unicode__(self):\n        return self.text if self.text else _(u'No condition specified')\n\n    def iati_type(self):\n        return codelist_value(ConditionType, self, 'type')\n\n    class Meta:\n        app_label = 'rsr'\n        verbose_name = _(u'condition')\n        verbose_name_plural = _(u'conditions')\n", "path": "akvo/rsr/models/project_condition.py"}]}