prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Session Export CSV does not include all data 
  The Session Export should export all data sets that are available e.g. including:
  * Submission time
  * All speakers
  * Proposed length
  * Type (Workshop, Talk)
  * Level (e.g. Intermediate)
  * Status (e.g. pending, accepted etc.)
  
  ![screenshot from 2019-01-17 00-04-14](https://user-images.githubusercontent.com/1583873/51284380-a3f0ff80-19eb-11e9-9a1c-3b37c6ad36ad.png)
  
  </issue>
  <code>
  [start of app/api/helpers/csv_jobs_util.py]
  1 from app.models.helpers.versioning import strip_tags
  2 
  3 
  4 def export_orders_csv(orders):
  5     headers = ['Order#', 'Order Date', 'Status', 'Payment Type', 'Total Amount', 'Quantity',
  6                'Discount Code', 'First Name', 'Last Name', 'Email']
  7 
  8     rows = [headers]
  9     for order in orders:
  10         if order.status != "deleted":
  11             column = [str(order.get_invoice_number()), str(order.created_at) if order.created_at else '',
  12                       str(order.status) if order.status else '', str(order.paid_via) if order.paid_via else '',
  13                       str(order.amount) if order.amount else '', str(order.tickets_count),
  14                       str(order.discount_code.code) if order.discount_code else '',
  15                       str(order.user.first_name)
  16                       if order.user and order.user.first_name else '',
  17                       str(order.user.last_name)
  18                       if order.user and order.user.last_name else '',
  19                       str(order.user.email) if order.user and order.user.email else '']
  20             rows.append(column)
  21 
  22     return rows
  23 
  24 
  25 def export_attendees_csv(attendees):
  26     headers = ['Order#', 'Order Date', 'Status', 'First Name', 'Last Name', 'Email',
  27                'Country', 'Payment Type', 'Ticket Name', 'Ticket Price', 'Ticket Type']
  28 
  29     rows = [headers]
  30     for attendee in attendees:
  31         column = [str(attendee.order.get_invoice_number()) if attendee.order else '-',
  32                   str(attendee.order.created_at) if attendee.order and attendee.order.created_at else '-',
  33                   str(attendee.order.status) if attendee.order and attendee.order.status else '-',
  34                   str(attendee.firstname) if attendee.firstname else '',
  35                   str(attendee.lastname) if attendee.lastname else '',
  36                   str(attendee.email) if attendee.email else '',
  37                   str(attendee.country) if attendee.country else '',
  38                   str(attendee.order.payment_mode) if attendee.order and attendee.order.payment_mode else '',
  39                   str(attendee.ticket.name) if attendee.ticket and attendee.ticket.name else '',
  40                   str(attendee.ticket.price) if attendee.ticket and attendee.ticket.price else '0',
  41                   str(attendee.ticket.type) if attendee.ticket and attendee.ticket.type else '']
  42 
  43         rows.append(column)
  44 
  45     return rows
  46 
  47 
  48 def export_sessions_csv(sessions):
  49     headers = ['Session Title', 'Session Speakers',
  50                'Session Track', 'Session Abstract', 'Created At', 'Email Sent']
  51     rows = [headers]
  52     for session in sessions:
  53         if not session.deleted_at:
  54             column = [session.title + ' (' + session.state + ')' if session.title else '']
  55             if session.speakers:
  56                 in_session = ''
  57                 for speaker in session.speakers:
  58                     if speaker.name:
  59                         in_session += (speaker.name + '; ')
  60                 column.append(in_session[:-2])
  61             else:
  62                 column.append('')
  63             column.append(session.track.name if session.track and session.track.name else '')
  64             column.append(strip_tags(session.short_abstract) if session.short_abstract else '')
  65             column.append(session.created_at if session.created_at else '')
  66             column.append('Yes' if session.is_mail_sent else 'No')
  67             rows.append(column)
  68 
  69     return rows
  70 
  71 
  72 def export_speakers_csv(speakers):
  73     headers = ['Speaker Name', 'Speaker Email', 'Speaker Session(s)',
  74                'Speaker Mobile', 'Speaker Bio', 'Speaker Organisation', 'Speaker Position']
  75     rows = [headers]
  76     for speaker in speakers:
  77         column = [speaker.name if speaker.name else '', speaker.email if speaker.email else '']
  78         if speaker.sessions:
  79             session_details = ''
  80             for session in speaker.sessions:
  81                 if not session.deleted_at:
  82                     session_details += session.title + ' (' + session.state + '); '
  83             column.append(session_details[:-2])
  84         else:
  85             column.append('')
  86         column.append(speaker.mobile if speaker.mobile else '')
  87         column.append(speaker.short_biography if speaker.short_biography else '')
  88         column.append(speaker.organisation if speaker.organisation else '')
  89         column.append(speaker.position if speaker.position else '')
  90         rows.append(column)
  91 
  92     return rows
  93
  [end of app/api/helpers/csv_jobs_util.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/app/api/helpers/csv_jobs_util.py b/app/api/helpers/csv_jobs_util.py
  --- a/app/api/helpers/csv_jobs_util.py
  +++ b/app/api/helpers/csv_jobs_util.py
  @@ -47,7 +47,8 @@
   
   def export_sessions_csv(sessions):
       headers = ['Session Title', 'Session Speakers',
  -               'Session Track', 'Session Abstract', 'Created At', 'Email Sent']
  +               'Session Track', 'Session Abstract', 'Created At', 'Email Sent',
  +               'Level', 'Status', 'Session Type', 'Talk Length']
       rows = [headers]
       for session in sessions:
           if not session.deleted_at:
  @@ -64,6 +65,10 @@
               column.append(strip_tags(session.short_abstract) if session.short_abstract else '')
               column.append(session.created_at if session.created_at else '')
               column.append('Yes' if session.is_mail_sent else 'No')
  +            column.append(session.level)
  +            column.append(session.state)
  +            column.append(session.type)
  +            column.append(len(session.long_abstract))
               rows.append(column)
   
       return rows
  
verification_info: {"golden_diff": "diff --git a/app/api/helpers/csv_jobs_util.py b/app/api/helpers/csv_jobs_util.py\n--- a/app/api/helpers/csv_jobs_util.py\n+++ b/app/api/helpers/csv_jobs_util.py\n@@ -47,7 +47,8 @@\n \n def export_sessions_csv(sessions):\n     headers = ['Session Title', 'Session Speakers',\n-               'Session Track', 'Session Abstract', 'Created At', 'Email Sent']\n+               'Session Track', 'Session Abstract', 'Created At', 'Email Sent',\n+               'Level', 'Status', 'Session Type', 'Talk Length']\n     rows = [headers]\n     for session in sessions:\n         if not session.deleted_at:\n@@ -64,6 +65,10 @@\n             column.append(strip_tags(session.short_abstract) if session.short_abstract else '')\n             column.append(session.created_at if session.created_at else '')\n             column.append('Yes' if session.is_mail_sent else 'No')\n+            column.append(session.level)\n+            column.append(session.state)\n+            column.append(session.type)\n+            column.append(len(session.long_abstract))\n             rows.append(column)\n \n     return rows\n", "issue": "Session Export CSV does not include all data \nThe Session Export should export all data sets that are available e.g. including:\r\n* Submission time\r\n* All speakers\r\n* Proposed length\r\n* Type (Workshop, Talk)\r\n* Level (e.g. Intermediate)\r\n* Status (e.g. pending, accepted etc.)\r\n\r\n![screenshot from 2019-01-17 00-04-14](https://user-images.githubusercontent.com/1583873/51284380-a3f0ff80-19eb-11e9-9a1c-3b37c6ad36ad.png)\n", "before_files": [{"content": "from app.models.helpers.versioning import strip_tags\n\n\ndef export_orders_csv(orders):\n    headers = ['Order#', 'Order Date', 'Status', 'Payment Type', 'Total Amount', 'Quantity',\n               'Discount Code', 'First Name', 'Last Name', 'Email']\n\n    rows = [headers]\n    for order in orders:\n        if order.status != \"deleted\":\n            column = [str(order.get_invoice_number()), str(order.created_at) if order.created_at else '',\n                      str(order.status) if order.status else '', str(order.paid_via) if order.paid_via else '',\n                      str(order.amount) if order.amount else '', str(order.tickets_count),\n                      str(order.discount_code.code) if order.discount_code else '',\n                      str(order.user.first_name)\n                      if order.user and order.user.first_name else '',\n                      str(order.user.last_name)\n                      if order.user and order.user.last_name else '',\n                      str(order.user.email) if order.user and order.user.email else '']\n            rows.append(column)\n\n    return rows\n\n\ndef export_attendees_csv(attendees):\n    headers = ['Order#', 'Order Date', 'Status', 'First Name', 'Last Name', 'Email',\n               'Country', 'Payment Type', 'Ticket Name', 'Ticket Price', 'Ticket Type']\n\n    rows = [headers]\n    for attendee in attendees:\n        column = [str(attendee.order.get_invoice_number()) if attendee.order else '-',\n                  str(attendee.order.created_at) if attendee.order and attendee.order.created_at else '-',\n                  str(attendee.order.status) if attendee.order and attendee.order.status else '-',\n                  str(attendee.firstname) if attendee.firstname else '',\n                  str(attendee.lastname) if attendee.lastname else '',\n                  str(attendee.email) if attendee.email else '',\n                  str(attendee.country) if attendee.country else '',\n                  str(attendee.order.payment_mode) if attendee.order and attendee.order.payment_mode else '',\n                  str(attendee.ticket.name) if attendee.ticket and attendee.ticket.name else '',\n                  str(attendee.ticket.price) if attendee.ticket and attendee.ticket.price else '0',\n                  str(attendee.ticket.type) if attendee.ticket and attendee.ticket.type else '']\n\n        rows.append(column)\n\n    return rows\n\n\ndef export_sessions_csv(sessions):\n    headers = ['Session Title', 'Session Speakers',\n               'Session Track', 'Session Abstract', 'Created At', 'Email Sent']\n    rows = [headers]\n    for session in sessions:\n        if not session.deleted_at:\n            column = [session.title + ' (' + session.state + ')' if session.title else '']\n            if session.speakers:\n                in_session = ''\n                for speaker in session.speakers:\n                    if speaker.name:\n                        in_session += (speaker.name + '; ')\n                column.append(in_session[:-2])\n            else:\n                column.append('')\n            column.append(session.track.name if session.track and session.track.name else '')\n            column.append(strip_tags(session.short_abstract) if session.short_abstract else '')\n            column.append(session.created_at if session.created_at else '')\n            column.append('Yes' if session.is_mail_sent else 'No')\n            rows.append(column)\n\n    return rows\n\n\ndef export_speakers_csv(speakers):\n    headers = ['Speaker Name', 'Speaker Email', 'Speaker Session(s)',\n               'Speaker Mobile', 'Speaker Bio', 'Speaker Organisation', 'Speaker Position']\n    rows = [headers]\n    for speaker in speakers:\n        column = [speaker.name if speaker.name else '', speaker.email if speaker.email else '']\n        if speaker.sessions:\n            session_details = ''\n            for session in speaker.sessions:\n                if not session.deleted_at:\n                    session_details += session.title + ' (' + session.state + '); '\n            column.append(session_details[:-2])\n        else:\n            column.append('')\n        column.append(speaker.mobile if speaker.mobile else '')\n        column.append(speaker.short_biography if speaker.short_biography else '')\n        column.append(speaker.organisation if speaker.organisation else '')\n        column.append(speaker.position if speaker.position else '')\n        rows.append(column)\n\n    return rows\n", "path": "app/api/helpers/csv_jobs_util.py"}]}