prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  change(version num) change jumpserver version
  from 0.3.0 -> 0.3.1
  
  
  </issue>
  <code>
  [start of jperm/models.py]
  1 import datetime
  2 
  3 from django.db import models
  4 from jasset.models import Asset, AssetGroup
  5 from juser.models import User, UserGroup
  6 
  7 
  8 class PermLog(models.Model):
  9     datetime = models.DateTimeField(auto_now_add=True)
  10     action = models.CharField(max_length=100, null=True, blank=True, default='')
  11     results = models.CharField(max_length=1000, null=True, blank=True, default='')
  12     is_success = models.BooleanField(default=False)
  13     is_finish = models.BooleanField(default=False)
  14 
  15 
  16 class PermSudo(models.Model):
  17     name = models.CharField(max_length=100, unique=True)
  18     date_added = models.DateTimeField(auto_now=True)
  19     commands = models.TextField()
  20     comment = models.CharField(max_length=100, null=True, blank=True, default='')
  21 
  22     def __unicode__(self):
  23         return self.name
  24 
  25 
  26 class PermRole(models.Model):
  27     name = models.CharField(max_length=100, unique=True)
  28     comment = models.CharField(max_length=100, null=True, blank=True, default='')
  29     password = models.CharField(max_length=100)
  30     key_path = models.CharField(max_length=100)
  31     date_added = models.DateTimeField(auto_now=True)
  32     sudo = models.ManyToManyField(PermSudo, related_name='perm_role')
  33 
  34     def __unicode__(self):
  35         return self.name
  36 
  37 
  38 class PermRule(models.Model):
  39     date_added = models.DateTimeField(auto_now=True)
  40     name = models.CharField(max_length=100, unique=True)
  41     comment = models.CharField(max_length=100)
  42     asset = models.ManyToManyField(Asset, related_name='perm_rule')
  43     asset_group = models.ManyToManyField(AssetGroup, related_name='perm_rule')
  44     user = models.ManyToManyField(User, related_name='perm_rule')
  45     user_group = models.ManyToManyField(UserGroup, related_name='perm_rule')
  46     role = models.ManyToManyField(PermRole, related_name='perm_rule')
  47 
  48     def __unicode__(self):
  49         return self.name
  50 
  51 
  52 class PermPush(models.Model):
  53     asset = models.ForeignKey(Asset, related_name='perm_push')
  54     role = models.ForeignKey(PermRole, related_name='perm_push')
  55     is_public_key = models.BooleanField(default=False)
  56     is_password = models.BooleanField(default=False)
  57     success = models.BooleanField(default=False)
  58     result = models.TextField(default='')
  59     date_added = models.DateTimeField(auto_now=True)
  60 
  61
  [end of jperm/models.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/jperm/models.py b/jperm/models.py
  --- a/jperm/models.py
  +++ b/jperm/models.py
  @@ -26,7 +26,7 @@
   class PermRole(models.Model):
       name = models.CharField(max_length=100, unique=True)
       comment = models.CharField(max_length=100, null=True, blank=True, default='')
  -    password = models.CharField(max_length=100)
  +    password = models.CharField(max_length=128)
       key_path = models.CharField(max_length=100)
       date_added = models.DateTimeField(auto_now=True)
       sudo = models.ManyToManyField(PermSudo, related_name='perm_role')
  
verification_info: {"golden_diff": "diff --git a/jperm/models.py b/jperm/models.py\n--- a/jperm/models.py\n+++ b/jperm/models.py\n@@ -26,7 +26,7 @@\n class PermRole(models.Model):\n     name = models.CharField(max_length=100, unique=True)\n     comment = models.CharField(max_length=100, null=True, blank=True, default='')\n-    password = models.CharField(max_length=100)\n+    password = models.CharField(max_length=128)\n     key_path = models.CharField(max_length=100)\n     date_added = models.DateTimeField(auto_now=True)\n     sudo = models.ManyToManyField(PermSudo, related_name='perm_role')\n", "issue": "change(version num) change jumpserver version\nfrom 0.3.0 -> 0.3.1\n\n", "before_files": [{"content": "import datetime\n\nfrom django.db import models\nfrom jasset.models import Asset, AssetGroup\nfrom juser.models import User, UserGroup\n\n\nclass PermLog(models.Model):\n    datetime = models.DateTimeField(auto_now_add=True)\n    action = models.CharField(max_length=100, null=True, blank=True, default='')\n    results = models.CharField(max_length=1000, null=True, blank=True, default='')\n    is_success = models.BooleanField(default=False)\n    is_finish = models.BooleanField(default=False)\n\n\nclass PermSudo(models.Model):\n    name = models.CharField(max_length=100, unique=True)\n    date_added = models.DateTimeField(auto_now=True)\n    commands = models.TextField()\n    comment = models.CharField(max_length=100, null=True, blank=True, default='')\n\n    def __unicode__(self):\n        return self.name\n\n\nclass PermRole(models.Model):\n    name = models.CharField(max_length=100, unique=True)\n    comment = models.CharField(max_length=100, null=True, blank=True, default='')\n    password = models.CharField(max_length=100)\n    key_path = models.CharField(max_length=100)\n    date_added = models.DateTimeField(auto_now=True)\n    sudo = models.ManyToManyField(PermSudo, related_name='perm_role')\n\n    def __unicode__(self):\n        return self.name\n\n\nclass PermRule(models.Model):\n    date_added = models.DateTimeField(auto_now=True)\n    name = models.CharField(max_length=100, unique=True)\n    comment = models.CharField(max_length=100)\n    asset = models.ManyToManyField(Asset, related_name='perm_rule')\n    asset_group = models.ManyToManyField(AssetGroup, related_name='perm_rule')\n    user = models.ManyToManyField(User, related_name='perm_rule')\n    user_group = models.ManyToManyField(UserGroup, related_name='perm_rule')\n    role = models.ManyToManyField(PermRole, related_name='perm_rule')\n\n    def __unicode__(self):\n        return self.name\n\n\nclass PermPush(models.Model):\n    asset = models.ForeignKey(Asset, related_name='perm_push')\n    role = models.ForeignKey(PermRole, related_name='perm_push')\n    is_public_key = models.BooleanField(default=False)\n    is_password = models.BooleanField(default=False)\n    success = models.BooleanField(default=False)\n    result = models.TextField(default='')\n    date_added = models.DateTimeField(auto_now=True)\n\n", "path": "jperm/models.py"}]}