prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Mauvais titre de notification pour le signalement de billet
  **Description du bug**
  
  Lorsqu'un membre signale un billet, le titre de la notification est `(<bound method PublishedContent.title of <PublishedContent: Version publique de "La Belgique a un nouveau gouvernement, ça se fête !">>,)` au lieu d'être le nom du contenu.
  
  **Comment reproduire ?**
  
  La liste des étapes qui permet de reproduire le bug :
  
  1. Aller sur le site
  2. Connectez vous avec le compte admin
  3. Aller sur un billet
  4. Cliquez sur « Signaler le contenu »
  5. Voir que le titre de la nouvelle notification de signalement est incorrect
  
  **Comportement attendu**
  
  Le titre de la nouvelle notification de signalement est le titre du contenu.
  
  </issue>
  <code>
  [start of zds/utils/header_notifications.py]
  1 from django.contrib.contenttypes.models import ContentType
  2 from django.utils.translation import gettext_lazy as _
  3 
  4 from zds.forum.models import Post
  5 from zds.mp.models import PrivateTopic
  6 from zds.notification.models import Notification
  7 from zds.tutorialv2.models.database import ContentReaction, PublishableContent
  8 from zds.utils.models import Alert
  9 
  10 
  11 def _notifications_to_list(notifications_query):
  12     query = notifications_query.select_related("sender__profile").order_by("-pubdate")[:10]
  13 
  14     return [{"pubdate": n.pubdate, "author": n.sender, "title": n.title, "url": n.url} for n in query]
  15 
  16 
  17 def _get_alert_info(alert):
  18     if alert.scope == "FORUM":
  19         post = Post.objects.select_related("topic").get(pk=alert.comment.pk)
  20         return post.topic.title, post.get_absolute_url()
  21     elif alert.scope == "CONTENT":
  22         published = PublishableContent.objects.select_related("public_version").get(pk=alert.content.pk)
  23         title = (published.public_version.title if published.public_version else published.title,)
  24         url = published.get_absolute_url_online() if published.public_version else ""
  25         return title, url
  26     elif alert.scope == "PROFILE":
  27         return _("Profil de {}").format(alert.profile.user.username), alert.profile.get_absolute_url() + "#alerts"
  28     else:
  29         comment = ContentReaction.objects.select_related("related_content").get(pk=alert.comment.pk)
  30         return (
  31             comment.related_content.title,
  32             comment.get_absolute_url(),
  33         )
  34 
  35 
  36 def _alert_to_dict(alert):
  37     title, url = _get_alert_info(alert)
  38     return {"title": title, "url": url, "pubdate": alert.pubdate, "author": alert.author, "text": alert.text}
  39 
  40 
  41 def _alerts_to_list(alerts_query):
  42     query = alerts_query.select_related("author", "comment", "content").order_by("-pubdate")[:10]
  43 
  44     return [_alert_to_dict(a) for a in query]
  45 
  46 
  47 def get_header_notifications(user):
  48     if not user.is_authenticated:
  49         return None
  50 
  51     private_topic = ContentType.objects.get_for_model(PrivateTopic)
  52 
  53     notifications = Notification.objects.filter(subscription__user=user, is_read=False)
  54 
  55     general_notifications = notifications.exclude(subscription__content_type=private_topic)
  56 
  57     private_notifications = notifications.filter(subscription__content_type=private_topic)
  58 
  59     alerts = Alert.objects.filter(solved=False)
  60 
  61     return {
  62         "general_notifications": {
  63             "total": general_notifications.count(),
  64             "list": _notifications_to_list(general_notifications),
  65         },
  66         "private_topic_notifications": {
  67             "total": private_notifications.count(),
  68             "list": _notifications_to_list(private_notifications),
  69         },
  70         "alerts": user.has_perm("forum.change_post")
  71         and {
  72             "total": alerts.count(),
  73             "list": _alerts_to_list(alerts),
  74         },
  75     }
  76
  [end of zds/utils/header_notifications.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/zds/utils/header_notifications.py b/zds/utils/header_notifications.py
  --- a/zds/utils/header_notifications.py
  +++ b/zds/utils/header_notifications.py
  @@ -20,7 +20,7 @@
           return post.topic.title, post.get_absolute_url()
       elif alert.scope == "CONTENT":
           published = PublishableContent.objects.select_related("public_version").get(pk=alert.content.pk)
  -        title = (published.public_version.title if published.public_version else published.title,)
  +        title = published.public_version.title if published.public_version else published.title
           url = published.get_absolute_url_online() if published.public_version else ""
           return title, url
       elif alert.scope == "PROFILE":
  
verification_info: {"golden_diff": "diff --git a/zds/utils/header_notifications.py b/zds/utils/header_notifications.py\n--- a/zds/utils/header_notifications.py\n+++ b/zds/utils/header_notifications.py\n@@ -20,7 +20,7 @@\n         return post.topic.title, post.get_absolute_url()\n     elif alert.scope == \"CONTENT\":\n         published = PublishableContent.objects.select_related(\"public_version\").get(pk=alert.content.pk)\n-        title = (published.public_version.title if published.public_version else published.title,)\n+        title = published.public_version.title if published.public_version else published.title\n         url = published.get_absolute_url_online() if published.public_version else \"\"\n         return title, url\n     elif alert.scope == \"PROFILE\":\n", "issue": "Mauvais titre de notification pour le signalement de billet\n**Description du bug**\r\n\r\nLorsqu'un membre signale un billet, le titre de la notification est `(<bound method PublishedContent.title of <PublishedContent: Version publique de \"La Belgique a un nouveau gouvernement, \u00e7a se f\u00eate !\">>,)` au lieu d'\u00eatre le nom du contenu.\r\n\r\n**Comment reproduire ?**\r\n\r\nLa liste des \u00e9tapes qui permet de reproduire le bug :\r\n\r\n1. Aller sur le site\r\n2. Connectez vous avec le compte admin\r\n3. Aller sur un billet\r\n4. Cliquez sur \u00ab Signaler le contenu \u00bb\r\n5. Voir que le titre de la nouvelle notification de signalement est incorrect\r\n\r\n**Comportement attendu**\r\n\r\nLe titre de la nouvelle notification de signalement est le titre du contenu.\n", "before_files": [{"content": "from django.contrib.contenttypes.models import ContentType\nfrom django.utils.translation import gettext_lazy as _\n\nfrom zds.forum.models import Post\nfrom zds.mp.models import PrivateTopic\nfrom zds.notification.models import Notification\nfrom zds.tutorialv2.models.database import ContentReaction, PublishableContent\nfrom zds.utils.models import Alert\n\n\ndef _notifications_to_list(notifications_query):\n    query = notifications_query.select_related(\"sender__profile\").order_by(\"-pubdate\")[:10]\n\n    return [{\"pubdate\": n.pubdate, \"author\": n.sender, \"title\": n.title, \"url\": n.url} for n in query]\n\n\ndef _get_alert_info(alert):\n    if alert.scope == \"FORUM\":\n        post = Post.objects.select_related(\"topic\").get(pk=alert.comment.pk)\n        return post.topic.title, post.get_absolute_url()\n    elif alert.scope == \"CONTENT\":\n        published = PublishableContent.objects.select_related(\"public_version\").get(pk=alert.content.pk)\n        title = (published.public_version.title if published.public_version else published.title,)\n        url = published.get_absolute_url_online() if published.public_version else \"\"\n        return title, url\n    elif alert.scope == \"PROFILE\":\n        return _(\"Profil de {}\").format(alert.profile.user.username), alert.profile.get_absolute_url() + \"#alerts\"\n    else:\n        comment = ContentReaction.objects.select_related(\"related_content\").get(pk=alert.comment.pk)\n        return (\n            comment.related_content.title,\n            comment.get_absolute_url(),\n        )\n\n\ndef _alert_to_dict(alert):\n    title, url = _get_alert_info(alert)\n    return {\"title\": title, \"url\": url, \"pubdate\": alert.pubdate, \"author\": alert.author, \"text\": alert.text}\n\n\ndef _alerts_to_list(alerts_query):\n    query = alerts_query.select_related(\"author\", \"comment\", \"content\").order_by(\"-pubdate\")[:10]\n\n    return [_alert_to_dict(a) for a in query]\n\n\ndef get_header_notifications(user):\n    if not user.is_authenticated:\n        return None\n\n    private_topic = ContentType.objects.get_for_model(PrivateTopic)\n\n    notifications = Notification.objects.filter(subscription__user=user, is_read=False)\n\n    general_notifications = notifications.exclude(subscription__content_type=private_topic)\n\n    private_notifications = notifications.filter(subscription__content_type=private_topic)\n\n    alerts = Alert.objects.filter(solved=False)\n\n    return {\n        \"general_notifications\": {\n            \"total\": general_notifications.count(),\n            \"list\": _notifications_to_list(general_notifications),\n        },\n        \"private_topic_notifications\": {\n            \"total\": private_notifications.count(),\n            \"list\": _notifications_to_list(private_notifications),\n        },\n        \"alerts\": user.has_perm(\"forum.change_post\")\n        and {\n            \"total\": alerts.count(),\n            \"list\": _alerts_to_list(alerts),\n        },\n    }\n", "path": "zds/utils/header_notifications.py"}]}