prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  testing #2252 follow mail: mail participation ends soon
  Where: Mail "participation ends soon"
  
  * in a single module project link should go to project view and not to a module view that does not regularly exist in this case. Is that possible?
  * As in the other mails: paragraph between two sentences probably looks better.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `meinberlin/apps/offlineevents/models.py`
  Content:
  ```
  1 from datetime import timedelta
  2 
  3 from autoslug import AutoSlugField
  4 from ckeditor_uploader.fields import RichTextUploadingField
  5 from django.db import models
  6 from django.urls import reverse
  7 from django.utils import timezone
  8 from django.utils.translation import ugettext_lazy as _
  9 
  10 from adhocracy4 import transforms
  11 from adhocracy4.models.base import UserGeneratedContentModel
  12 from adhocracy4.projects import models as project_models
  13 
  14 
  15 class OfflineEventsQuerySet(models.QuerySet):
  16 
  17     def starts_within(self, hours=72):
  18         """All offlineevents starting within the given time."""
  19         now = timezone.now()
  20         return self.filter(date__gt=now,
  21                            date__lt=(now + timedelta(hours=hours)))
  22 
  23 
  24 class OfflineEvent(UserGeneratedContentModel):
  25     slug = AutoSlugField(populate_from='name', unique=True)
  26     name = models.CharField(max_length=120, verbose_name=_('Name of event'))
  27     event_type = models.CharField(
  28         max_length=30, verbose_name=_('Event type'),
  29         help_text=_('The content of this field is shown in the timeline. It '
  30                     'should have no more than 30 characters e.g. Information '
  31                     'event or 3rd public workshop.'))
  32     date = models.DateTimeField(
  33         verbose_name=_('Date'))
  34     description = RichTextUploadingField(
  35         config_name='image-editor',
  36         verbose_name=_('Description'))
  37     project = models.ForeignKey(
  38         project_models.Project, on_delete=models.CASCADE)
  39 
  40     objects = OfflineEventsQuerySet.as_manager()
  41 
  42     class Meta:
  43         ordering = ['-date']
  44 
  45     def __str__(self):
  46         return self.name
  47 
  48     def save(self, *args, **kwargs):
  49         self.description = transforms.clean_html_field(
  50             self.description, 'image-editor')
  51         super().save(*args, **kwargs)
  52 
  53     def get_absolute_url(self):
  54         return reverse('meinberlin_offlineevents:offlineevent-detail',
  55                        args=[str(self.slug)])
  56
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/meinberlin/apps/offlineevents/models.py b/meinberlin/apps/offlineevents/models.py
  --- a/meinberlin/apps/offlineevents/models.py
  +++ b/meinberlin/apps/offlineevents/models.py
  @@ -3,8 +3,8 @@
   from autoslug import AutoSlugField
   from ckeditor_uploader.fields import RichTextUploadingField
   from django.db import models
  -from django.urls import reverse
   from django.utils import timezone
  +from django.utils.functional import cached_property
   from django.utils.translation import ugettext_lazy as _
   
   from adhocracy4 import transforms
  @@ -50,6 +50,16 @@
               self.description, 'image-editor')
           super().save(*args, **kwargs)
   
  +    @cached_property
  +    def get_timeline_index(self):
  +        if self.project.display_timeline:
  +            for count, cluster in enumerate(self.project.participation_dates):
  +                if 'event_type' in cluster and self.slug == cluster['slug']:
  +                    return count
  +        return 0
  +
       def get_absolute_url(self):
  -        return reverse('meinberlin_offlineevents:offlineevent-detail',
  -                       args=[str(self.slug)])
  +        if self.project.display_timeline:
  +            return '{}?initialSlide={}'.format(self.project.get_absolute_url(),
  +                                               self.get_timeline_index)
  +        return self.project.get_absolute_url()
  
verification_info: {"golden_diff": "diff --git a/meinberlin/apps/offlineevents/models.py b/meinberlin/apps/offlineevents/models.py\n--- a/meinberlin/apps/offlineevents/models.py\n+++ b/meinberlin/apps/offlineevents/models.py\n@@ -3,8 +3,8 @@\n from autoslug import AutoSlugField\n from ckeditor_uploader.fields import RichTextUploadingField\n from django.db import models\n-from django.urls import reverse\n from django.utils import timezone\n+from django.utils.functional import cached_property\n from django.utils.translation import ugettext_lazy as _\n \n from adhocracy4 import transforms\n@@ -50,6 +50,16 @@\n             self.description, 'image-editor')\n         super().save(*args, **kwargs)\n \n+    @cached_property\n+    def get_timeline_index(self):\n+        if self.project.display_timeline:\n+            for count, cluster in enumerate(self.project.participation_dates):\n+                if 'event_type' in cluster and self.slug == cluster['slug']:\n+                    return count\n+        return 0\n+\n     def get_absolute_url(self):\n-        return reverse('meinberlin_offlineevents:offlineevent-detail',\n-                       args=[str(self.slug)])\n+        if self.project.display_timeline:\n+            return '{}?initialSlide={}'.format(self.project.get_absolute_url(),\n+                                               self.get_timeline_index)\n+        return self.project.get_absolute_url()\n", "issue": "testing #2252 follow mail: mail participation ends soon\nWhere: Mail \"participation ends soon\"\r\n\r\n* in a single module project link should go to project view and not to a module view that does not regularly exist in this case. Is that possible?\r\n* As in the other mails: paragraph between two sentences probably looks better.\n", "before_files": [{"content": "from datetime import timedelta\n\nfrom autoslug import AutoSlugField\nfrom ckeditor_uploader.fields import RichTextUploadingField\nfrom django.db import models\nfrom django.urls import reverse\nfrom django.utils import timezone\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4 import transforms\nfrom adhocracy4.models.base import UserGeneratedContentModel\nfrom adhocracy4.projects import models as project_models\n\n\nclass OfflineEventsQuerySet(models.QuerySet):\n\n    def starts_within(self, hours=72):\n        \"\"\"All offlineevents starting within the given time.\"\"\"\n        now = timezone.now()\n        return self.filter(date__gt=now,\n                           date__lt=(now + timedelta(hours=hours)))\n\n\nclass OfflineEvent(UserGeneratedContentModel):\n    slug = AutoSlugField(populate_from='name', unique=True)\n    name = models.CharField(max_length=120, verbose_name=_('Name of event'))\n    event_type = models.CharField(\n        max_length=30, verbose_name=_('Event type'),\n        help_text=_('The content of this field is shown in the timeline. It '\n                    'should have no more than 30 characters e.g. Information '\n                    'event or 3rd public workshop.'))\n    date = models.DateTimeField(\n        verbose_name=_('Date'))\n    description = RichTextUploadingField(\n        config_name='image-editor',\n        verbose_name=_('Description'))\n    project = models.ForeignKey(\n        project_models.Project, on_delete=models.CASCADE)\n\n    objects = OfflineEventsQuerySet.as_manager()\n\n    class Meta:\n        ordering = ['-date']\n\n    def __str__(self):\n        return self.name\n\n    def save(self, *args, **kwargs):\n        self.description = transforms.clean_html_field(\n            self.description, 'image-editor')\n        super().save(*args, **kwargs)\n\n    def get_absolute_url(self):\n        return reverse('meinberlin_offlineevents:offlineevent-detail',\n                       args=[str(self.slug)])\n", "path": "meinberlin/apps/offlineevents/models.py"}], "after_files": [{"content": "from datetime import timedelta\n\nfrom autoslug import AutoSlugField\nfrom ckeditor_uploader.fields import RichTextUploadingField\nfrom django.db import models\nfrom django.utils import timezone\nfrom django.utils.functional import cached_property\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4 import transforms\nfrom adhocracy4.models.base import UserGeneratedContentModel\nfrom adhocracy4.projects import models as project_models\n\n\nclass OfflineEventsQuerySet(models.QuerySet):\n\n    def starts_within(self, hours=72):\n        \"\"\"All offlineevents starting within the given time.\"\"\"\n        now = timezone.now()\n        return self.filter(date__gt=now,\n                           date__lt=(now + timedelta(hours=hours)))\n\n\nclass OfflineEvent(UserGeneratedContentModel):\n    slug = AutoSlugField(populate_from='name', unique=True)\n    name = models.CharField(max_length=120, verbose_name=_('Name of event'))\n    event_type = models.CharField(\n        max_length=30, verbose_name=_('Event type'),\n        help_text=_('The content of this field is shown in the timeline. It '\n                    'should have no more than 30 characters e.g. Information '\n                    'event or 3rd public workshop.'))\n    date = models.DateTimeField(\n        verbose_name=_('Date'))\n    description = RichTextUploadingField(\n        config_name='image-editor',\n        verbose_name=_('Description'))\n    project = models.ForeignKey(\n        project_models.Project, on_delete=models.CASCADE)\n\n    objects = OfflineEventsQuerySet.as_manager()\n\n    class Meta:\n        ordering = ['-date']\n\n    def __str__(self):\n        return self.name\n\n    def save(self, *args, **kwargs):\n        self.description = transforms.clean_html_field(\n            self.description, 'image-editor')\n        super().save(*args, **kwargs)\n\n    @cached_property\n    def get_timeline_index(self):\n        if self.project.display_timeline:\n            for count, cluster in enumerate(self.project.participation_dates):\n                if 'event_type' in cluster and self.slug == cluster['slug']:\n                    return count\n        return 0\n\n    def get_absolute_url(self):\n        if self.project.display_timeline:\n            return '{}?initialSlide={}'.format(self.project.get_absolute_url(),\n                                               self.get_timeline_index)\n        return self.project.get_absolute_url()\n", "path": "meinberlin/apps/offlineevents/models.py"}]}