We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
timeline wrong way?
the phases in the timeline seem to be sorted in the wrong direction:
![bildschirmfoto 2016-10-21 um 13 33 06](https://cloud.githubusercontent.com/assets/2905743/19597159/1eee7114-9793-11e6-97f9-5acd3d610f46.png)
![bildschirmfoto 2016-10-21 um 13 33 18](https://cloud.githubusercontent.com/assets/2905743/19597161/22f8492e-9793-11e6-97a6-8b7e4e2b4388.png)


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `euth/phases/models.py`
Content:
```
1 from django.core.exceptions import ValidationError
2 from django.db import models
3 from django.utils import timezone
4 from django.utils.translation import ugettext as _
5 
6 from euth.modules import models as modules_models
7 
8 from . import content
9 from .validators import validate_content
10 
11 
12 class PhasesQuerySet(models.QuerySet):
13 
14     def active_phases(self):
15         now = timezone.now()
16         return self.filter(start_date__lte=now, end_date__gt=now)
17 
18 
19 class Phase(models.Model):
20     name = models.CharField(max_length=80)
21     description = models.TextField(max_length=300)
22     type = models.CharField(max_length=128, validators=[validate_content])
23     module = models.ForeignKey(modules_models.Module, on_delete=models.CASCADE)
24     start_date = models.DateTimeField(blank=True, null=True)
25     end_date = models.DateTimeField(blank=True, null=True)
26 
27     objects = PhasesQuerySet.as_manager()
28 
29     def __str__(self):
30         return '{} ({})'.format(self.name, self.type)
31 
32     def content(self):
33         return content[self.type]
34 
35     def clean(self):
36         if self.end_date and self.start_date:
37             if self.end_date < self.start_date:
38                 raise ValidationError({
39                     'end_date': _('End date can not be smaller'
40                                   'than the start date.')
41                 })
42         super().clean()
43 
44     @property
45     def view(self):
46         return content[self.type].view
47 
48     def has_feature(self, feature, model):
49         return content[self.type].has_feature(feature, model)
50
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/euth/phases/models.py b/euth/phases/models.py
--- a/euth/phases/models.py
+++ b/euth/phases/models.py
@@ -26,6 +26,9 @@
 
     objects = PhasesQuerySet.as_manager()
 
+    class Meta:
+        ordering = ['type']
+
     def __str__(self):
         return '{} ({})'.format(self.name, self.type)

{"golden_diff": "diff --git a/euth/phases/models.py b/euth/phases/models.py\n--- a/euth/phases/models.py\n+++ b/euth/phases/models.py\n@@ -26,6 +26,9 @@\n \n     objects = PhasesQuerySet.as_manager()\n \n+    class Meta:\n+        ordering = ['type']\n+\n     def __str__(self):\n         return '{} ({})'.format(self.name, self.type)\n", "issue": "timeline wrong way?\nthe phases in the timeline seem to be sorted in the wrong direction:\n![bildschirmfoto 2016-10-21 um 13 33 06](https://cloud.githubusercontent.com/assets/2905743/19597159/1eee7114-9793-11e6-97f9-5acd3d610f46.png)\n![bildschirmfoto 2016-10-21 um 13 33 18](https://cloud.githubusercontent.com/assets/2905743/19597161/22f8492e-9793-11e6-97a6-8b7e4e2b4388.png)\n\n", "before_files": [{"content": "from django.core.exceptions import ValidationError\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext as _\n\nfrom euth.modules import models as modules_models\n\nfrom . import content\nfrom .validators import validate_content\n\n\nclass PhasesQuerySet(models.QuerySet):\n\n    def active_phases(self):\n        now = timezone.now()\n        return self.filter(start_date__lte=now, end_date__gt=now)\n\n\nclass Phase(models.Model):\n    name = models.CharField(max_length=80)\n    description = models.TextField(max_length=300)\n    type = models.CharField(max_length=128, validators=[validate_content])\n    module = models.ForeignKey(modules_models.Module, on_delete=models.CASCADE)\n    start_date = models.DateTimeField(blank=True, null=True)\n    end_date = models.DateTimeField(blank=True, null=True)\n\n    objects = PhasesQuerySet.as_manager()\n\n    def __str__(self):\n        return '{} ({})'.format(self.name, self.type)\n\n    def content(self):\n        return content[self.type]\n\n    def clean(self):\n        if self.end_date and self.start_date:\n            if self.end_date < self.start_date:\n                raise ValidationError({\n                    'end_date': _('End date can not be smaller'\n                                  'than the start date.')\n                })\n        super().clean()\n\n    @property\n    def view(self):\n        return content[self.type].view\n\n    def has_feature(self, feature, model):\n        return content[self.type].has_feature(feature, model)\n", "path": "euth/phases/models.py"}], "after_files": [{"content": "from django.core.exceptions import ValidationError\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext as _\n\nfrom euth.modules import models as modules_models\n\nfrom . import content\nfrom .validators import validate_content\n\n\nclass PhasesQuerySet(models.QuerySet):\n\n    def active_phases(self):\n        now = timezone.now()\n        return self.filter(start_date__lte=now, end_date__gt=now)\n\n\nclass Phase(models.Model):\n    name = models.CharField(max_length=80)\n    description = models.TextField(max_length=300)\n    type = models.CharField(max_length=128, validators=[validate_content])\n    module = models.ForeignKey(modules_models.Module, on_delete=models.CASCADE)\n    start_date = models.DateTimeField(blank=True, null=True)\n    end_date = models.DateTimeField(blank=True, null=True)\n\n    objects = PhasesQuerySet.as_manager()\n\n    class Meta:\n        ordering = ['type']\n\n    def __str__(self):\n        return '{} ({})'.format(self.name, self.type)\n\n    def content(self):\n        return content[self.type]\n\n    def clean(self):\n        if self.end_date and self.start_date:\n            if self.end_date < self.start_date:\n                raise ValidationError({\n                    'end_date': _('End date can not be smaller'\n                                  'than the start date.')\n                })\n        super().clean()\n\n    @property\n    def view(self):\n        return content[self.type].view\n\n    def has_feature(self, feature, model):\n        return content[self.type].has_feature(feature, model)\n", "path": "euth/phases/models.py"}]}