prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Custom-forms: Change data.type in custom-form
  **I'm submitting a ...**  (check one with "x")
  - [x] bug report
  - [ ] feature request
  - [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-orga-server
  
  **Current behavior:**
  The type attribute is `custom_form` which leads to error 409 while making a request after #4300 
  
  **Expected behavior:**
  The type attribute should be `custom-form` 
  
  @enigmaeth Can you please check?
  
  </issue>
  <code>
  [start of app/api/custom_forms.py]
  1 from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship
  2 from marshmallow_jsonapi.flask import Schema, Relationship
  3 from marshmallow_jsonapi import fields
  4 import marshmallow.validate as validate
  5 from app.api.helpers.permissions import jwt_required
  6 from flask_rest_jsonapi.exceptions import ObjectNotFound
  7 
  8 from app.api.bootstrap import api
  9 from app.api.helpers.utilities import dasherize
  10 from app.models import db
  11 from app.models.custom_form import CustomForms
  12 from app.models.event import Event
  13 from app.api.helpers.db import safe_query
  14 from app.api.helpers.utilities import require_relationship
  15 from app.api.helpers.permission_manager import has_access
  16 from app.api.helpers.query import event_query
  17 
  18 
  19 class CustomFormSchema(Schema):
  20     """
  21     API Schema for Custom Forms database model
  22     """
  23     class Meta:
  24         """
  25         Meta class for CustomForm Schema
  26         """
  27         type_ = 'custom_form'
  28         self_view = 'v1.custom_form_detail'
  29         self_view_kwargs = {'id': '<id>'}
  30         inflect = dasherize
  31 
  32     id = fields.Integer(dump_only=True)
  33     field_identifier = fields.Str(required=True)
  34     form = fields.Str(required=True)
  35     type = fields.Str(default="text", validate=validate.OneOf(
  36         choices=["text", "checkbox", "select", "file", "image"]))
  37     is_required = fields.Boolean(default=False)
  38     is_included = fields.Boolean(default=False)
  39     is_fixed = fields.Boolean(default=False)
  40     event = Relationship(attribute='event',
  41                          self_view='v1.custom_form_event',
  42                          self_view_kwargs={'id': '<id>'},
  43                          related_view='v1.event_detail',
  44                          related_view_kwargs={'custom_form_id': '<id>'},
  45                          schema='EventSchema',
  46                          type_='event')
  47 
  48 
  49 class CustomFormListPost(ResourceList):
  50     """
  51     Create and List Custom Forms
  52     """
  53 
  54     def before_post(self, args, kwargs, data):
  55         """
  56         method to check for required relationship with event
  57         :param args:
  58         :param kwargs:
  59         :param data:
  60         :return:
  61         """
  62         require_relationship(['event'], data)
  63         if not has_access('is_coorganizer', event_id=data['event']):
  64             raise ObjectNotFound({'parameter': 'event_id'},
  65                                  "Event: {} not found".format(data['event_id']))
  66 
  67     schema = CustomFormSchema
  68     methods = ['POST', ]
  69     data_layer = {'session': db.session,
  70                   'model': CustomForms
  71                   }
  72 
  73 
  74 class CustomFormList(ResourceList):
  75     """
  76     Create and List Custom Forms
  77     """
  78     def query(self, view_kwargs):
  79         """
  80         query method for different view_kwargs
  81         :param view_kwargs:
  82         :return:
  83         """
  84         query_ = self.session.query(CustomForms)
  85         query_ = event_query(self, query_, view_kwargs)
  86         return query_
  87 
  88     view_kwargs = True
  89     decorators = (jwt_required, )
  90     methods = ['GET', ]
  91     schema = CustomFormSchema
  92     data_layer = {'session': db.session,
  93                   'model': CustomForms,
  94                   'methods': {
  95                       'query': query
  96                   }}
  97 
  98 
  99 class CustomFormDetail(ResourceDetail):
  100     """
  101     CustomForm Resource
  102     """
  103 
  104     def before_get_object(self, view_kwargs):
  105         """
  106         before get method
  107         :param view_kwargs:
  108         :return:
  109         """
  110         event = None
  111         if view_kwargs.get('event_id'):
  112             event = safe_query(self, Event, 'id', view_kwargs['event_id'], 'event_id')
  113         elif view_kwargs.get('event_identifier'):
  114             event = safe_query(self, Event, 'identifier', view_kwargs['event_identifier'], 'event_identifier')
  115 
  116         if event:
  117             custom_form = safe_query(self, CustomForms, 'event_id', event.id, 'event_id')
  118             view_kwargs['id'] = custom_form.id
  119 
  120     decorators = (api.has_permission('is_coorganizer', fetch='event_id',
  121                   fetch_as="event_id", model=CustomForms, methods="PATCH,DELETE"), )
  122     schema = CustomFormSchema
  123     data_layer = {'session': db.session,
  124                   'model': CustomForms}
  125 
  126 
  127 class CustomFormRelationshipRequired(ResourceRelationship):
  128     """
  129     CustomForm Relationship (Required)
  130     """
  131     decorators = (api.has_permission('is_coorganizer', fetch='event_id',
  132                                      fetch_as="event_id", model=CustomForms, methods="PATCH"),)
  133     methods = ['GET', 'PATCH']
  134     schema = CustomFormSchema
  135     data_layer = {'session': db.session,
  136                   'model': CustomForms}
  137
  [end of app/api/custom_forms.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/custom_forms.py b/app/api/custom_forms.py
  --- a/app/api/custom_forms.py
  +++ b/app/api/custom_forms.py
  @@ -24,7 +24,7 @@
           """
           Meta class for CustomForm Schema
           """
  -        type_ = 'custom_form'
  +        type_ = 'custom-form'
           self_view = 'v1.custom_form_detail'
           self_view_kwargs = {'id': '<id>'}
           inflect = dasherize
  
verification_info: {"golden_diff": "diff --git a/app/api/custom_forms.py b/app/api/custom_forms.py\n--- a/app/api/custom_forms.py\n+++ b/app/api/custom_forms.py\n@@ -24,7 +24,7 @@\n         \"\"\"\n         Meta class for CustomForm Schema\n         \"\"\"\n-        type_ = 'custom_form'\n+        type_ = 'custom-form'\n         self_view = 'v1.custom_form_detail'\n         self_view_kwargs = {'id': '<id>'}\n         inflect = dasherize\n", "issue": "Custom-forms: Change data.type in custom-form\n**I'm submitting a ...**  (check one with \"x\")\r\n- [x] bug report\r\n- [ ] feature request\r\n- [ ] support request => Please do not submit support requests here, instead ask your query in out Gitter channel at https://gitter.im/fossasia/open-event-orga-server\r\n\r\n**Current behavior:**\r\nThe type attribute is `custom_form` which leads to error 409 while making a request after #4300 \r\n\r\n**Expected behavior:**\r\nThe type attribute should be `custom-form` \r\n\r\n@enigmaeth Can you please check?\n", "before_files": [{"content": "from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship\nfrom marshmallow_jsonapi.flask import Schema, Relationship\nfrom marshmallow_jsonapi import fields\nimport marshmallow.validate as validate\nfrom app.api.helpers.permissions import jwt_required\nfrom flask_rest_jsonapi.exceptions import ObjectNotFound\n\nfrom app.api.bootstrap import api\nfrom app.api.helpers.utilities import dasherize\nfrom app.models import db\nfrom app.models.custom_form import CustomForms\nfrom app.models.event import Event\nfrom app.api.helpers.db import safe_query\nfrom app.api.helpers.utilities import require_relationship\nfrom app.api.helpers.permission_manager import has_access\nfrom app.api.helpers.query import event_query\n\n\nclass CustomFormSchema(Schema):\n    \"\"\"\n    API Schema for Custom Forms database model\n    \"\"\"\n    class Meta:\n        \"\"\"\n        Meta class for CustomForm Schema\n        \"\"\"\n        type_ = 'custom_form'\n        self_view = 'v1.custom_form_detail'\n        self_view_kwargs = {'id': '<id>'}\n        inflect = dasherize\n\n    id = fields.Integer(dump_only=True)\n    field_identifier = fields.Str(required=True)\n    form = fields.Str(required=True)\n    type = fields.Str(default=\"text\", validate=validate.OneOf(\n        choices=[\"text\", \"checkbox\", \"select\", \"file\", \"image\"]))\n    is_required = fields.Boolean(default=False)\n    is_included = fields.Boolean(default=False)\n    is_fixed = fields.Boolean(default=False)\n    event = Relationship(attribute='event',\n                         self_view='v1.custom_form_event',\n                         self_view_kwargs={'id': '<id>'},\n                         related_view='v1.event_detail',\n                         related_view_kwargs={'custom_form_id': '<id>'},\n                         schema='EventSchema',\n                         type_='event')\n\n\nclass CustomFormListPost(ResourceList):\n    \"\"\"\n    Create and List Custom Forms\n    \"\"\"\n\n    def before_post(self, args, kwargs, data):\n        \"\"\"\n        method to check for required relationship with event\n        :param args:\n        :param kwargs:\n        :param data:\n        :return:\n        \"\"\"\n        require_relationship(['event'], data)\n        if not has_access('is_coorganizer', event_id=data['event']):\n            raise ObjectNotFound({'parameter': 'event_id'},\n                                 \"Event: {} not found\".format(data['event_id']))\n\n    schema = CustomFormSchema\n    methods = ['POST', ]\n    data_layer = {'session': db.session,\n                  'model': CustomForms\n                  }\n\n\nclass CustomFormList(ResourceList):\n    \"\"\"\n    Create and List Custom Forms\n    \"\"\"\n    def query(self, view_kwargs):\n        \"\"\"\n        query method for different view_kwargs\n        :param view_kwargs:\n        :return:\n        \"\"\"\n        query_ = self.session.query(CustomForms)\n        query_ = event_query(self, query_, view_kwargs)\n        return query_\n\n    view_kwargs = True\n    decorators = (jwt_required, )\n    methods = ['GET', ]\n    schema = CustomFormSchema\n    data_layer = {'session': db.session,\n                  'model': CustomForms,\n                  'methods': {\n                      'query': query\n                  }}\n\n\nclass CustomFormDetail(ResourceDetail):\n    \"\"\"\n    CustomForm Resource\n    \"\"\"\n\n    def before_get_object(self, view_kwargs):\n        \"\"\"\n        before get method\n        :param view_kwargs:\n        :return:\n        \"\"\"\n        event = None\n        if view_kwargs.get('event_id'):\n            event = safe_query(self, Event, 'id', view_kwargs['event_id'], 'event_id')\n        elif view_kwargs.get('event_identifier'):\n            event = safe_query(self, Event, 'identifier', view_kwargs['event_identifier'], 'event_identifier')\n\n        if event:\n            custom_form = safe_query(self, CustomForms, 'event_id', event.id, 'event_id')\n            view_kwargs['id'] = custom_form.id\n\n    decorators = (api.has_permission('is_coorganizer', fetch='event_id',\n                  fetch_as=\"event_id\", model=CustomForms, methods=\"PATCH,DELETE\"), )\n    schema = CustomFormSchema\n    data_layer = {'session': db.session,\n                  'model': CustomForms}\n\n\nclass CustomFormRelationshipRequired(ResourceRelationship):\n    \"\"\"\n    CustomForm Relationship (Required)\n    \"\"\"\n    decorators = (api.has_permission('is_coorganizer', fetch='event_id',\n                                     fetch_as=\"event_id\", model=CustomForms, methods=\"PATCH\"),)\n    methods = ['GET', 'PATCH']\n    schema = CustomFormSchema\n    data_layer = {'session': db.session,\n                  'model': CustomForms}\n", "path": "app/api/custom_forms.py"}]}