prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: Kubernetes Deployment Info shown on heroku
  Do not try to show Kubernetes deployment info when not hosted on Kubernetes
  
  </issue>
  <code>
  [start of app/views/admin/super_admin/super_admin.py]
  1 import os
  2 
  3 from flask_admin import expose
  4 
  5 from app.views.admin.super_admin.super_admin_base import SuperAdminBaseView
  6 from ....helpers.data_getter import DataGetter
  7 from app.helpers.helpers import get_latest_heroku_release, get_commit_info, get_count
  8 from app.models.user import ATTENDEE,TRACK_ORGANIZER, COORGANIZER, ORGANIZER
  9 from app.helpers.kubernetes import KubernetesApi
  10 
  11 
  12 class SuperAdminView(SuperAdminBaseView):
  13 
  14     @expose('/')
  15     def index_view(self):
  16         events = DataGetter.get_all_events()[:5]
  17         number_live_events = get_count(DataGetter.get_all_live_events())
  18         number_draft_events = get_count(DataGetter.get_all_draft_events())
  19         number_past_events = get_count(DataGetter.get_all_past_events())
  20         super_admins = DataGetter.get_all_super_admins()
  21         admins = DataGetter.get_all_admins()
  22         registered_users = DataGetter.get_all_registered_users()
  23         # TODO Fix function and correct this
  24         organizers = get_count(DataGetter.get_all_user_roles(ORGANIZER))
  25         co_organizers = get_count(DataGetter.get_all_user_roles(COORGANIZER))
  26         track_organizers = get_count(DataGetter.get_all_user_roles(TRACK_ORGANIZER))
  27         attendees = get_count(DataGetter.get_all_user_roles(ATTENDEE))
  28         accepted_sessions = DataGetter.get_all_accepted_sessions()
  29         rejected_sessions = DataGetter.get_all_rejected_sessions()
  30         draft_sessions = DataGetter.get_all_draft_sessions()
  31         email_times = DataGetter.get_email_by_times()
  32 
  33         commit_info = None
  34         version = None
  35         on_kubernetes = False
  36         pods_info = None
  37 
  38         if KubernetesApi.is_on_kubernetes():
  39             on_kubernetes = True
  40             kubernetes_api = KubernetesApi()
  41             pods_info = kubernetes_api.get_pods()['items']
  42             version = os.getenv('REPOSITORY', 'https://github.com/fossasia/open-event-orga-server.git')
  43             commit_info = os.getenv('BRANCH', 'development')
  44         else:
  45             version = get_latest_heroku_release()
  46             commit_info = None
  47             commit_number = None
  48             if version:
  49                 commit_number = version['description'].split(' ')[1]
  50                 commit_info = get_commit_info(commit_number)
  51 
  52         return self.render('/gentelella/admin/super_admin/widgets/index.html',
  53                            events=events,
  54                            version=version,
  55                            commit_info=commit_info,
  56                            on_kubernetes=True,
  57                            pods_info=pods_info,
  58                            number_live_events=number_live_events,
  59                            number_draft_events=number_draft_events,
  60                            number_past_events=number_past_events,
  61                            super_admins=super_admins,
  62                            admins=admins,
  63                            registered_users=registered_users,
  64                            organizers=organizers,
  65                            co_organizers=co_organizers,
  66                            track_organizers=track_organizers,
  67                            attendees=attendees,
  68                            accepted_sessions=accepted_sessions,
  69                            rejected_sessions=rejected_sessions,
  70                            draft_sessions=draft_sessions,
  71                            email_times=email_times)
  72
  [end of app/views/admin/super_admin/super_admin.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/views/admin/super_admin/super_admin.py b/app/views/admin/super_admin/super_admin.py
  --- a/app/views/admin/super_admin/super_admin.py
  +++ b/app/views/admin/super_admin/super_admin.py
  @@ -53,7 +53,7 @@
                              events=events,
                              version=version,
                              commit_info=commit_info,
  -                           on_kubernetes=True,
  +                           on_kubernetes=on_kubernetes,
                              pods_info=pods_info,
                              number_live_events=number_live_events,
                              number_draft_events=number_draft_events,
  
verification_info: {"golden_diff": "diff --git a/app/views/admin/super_admin/super_admin.py b/app/views/admin/super_admin/super_admin.py\n--- a/app/views/admin/super_admin/super_admin.py\n+++ b/app/views/admin/super_admin/super_admin.py\n@@ -53,7 +53,7 @@\n                            events=events,\n                            version=version,\n                            commit_info=commit_info,\n-                           on_kubernetes=True,\n+                           on_kubernetes=on_kubernetes,\n                            pods_info=pods_info,\n                            number_live_events=number_live_events,\n                            number_draft_events=number_draft_events,\n", "issue": "Bug: Kubernetes Deployment Info shown on heroku\nDo not try to show Kubernetes deployment info when not hosted on Kubernetes\n", "before_files": [{"content": "import os\n\nfrom flask_admin import expose\n\nfrom app.views.admin.super_admin.super_admin_base import SuperAdminBaseView\nfrom ....helpers.data_getter import DataGetter\nfrom app.helpers.helpers import get_latest_heroku_release, get_commit_info, get_count\nfrom app.models.user import ATTENDEE,TRACK_ORGANIZER, COORGANIZER, ORGANIZER\nfrom app.helpers.kubernetes import KubernetesApi\n\n\nclass SuperAdminView(SuperAdminBaseView):\n\n    @expose('/')\n    def index_view(self):\n        events = DataGetter.get_all_events()[:5]\n        number_live_events = get_count(DataGetter.get_all_live_events())\n        number_draft_events = get_count(DataGetter.get_all_draft_events())\n        number_past_events = get_count(DataGetter.get_all_past_events())\n        super_admins = DataGetter.get_all_super_admins()\n        admins = DataGetter.get_all_admins()\n        registered_users = DataGetter.get_all_registered_users()\n        # TODO Fix function and correct this\n        organizers = get_count(DataGetter.get_all_user_roles(ORGANIZER))\n        co_organizers = get_count(DataGetter.get_all_user_roles(COORGANIZER))\n        track_organizers = get_count(DataGetter.get_all_user_roles(TRACK_ORGANIZER))\n        attendees = get_count(DataGetter.get_all_user_roles(ATTENDEE))\n        accepted_sessions = DataGetter.get_all_accepted_sessions()\n        rejected_sessions = DataGetter.get_all_rejected_sessions()\n        draft_sessions = DataGetter.get_all_draft_sessions()\n        email_times = DataGetter.get_email_by_times()\n\n        commit_info = None\n        version = None\n        on_kubernetes = False\n        pods_info = None\n\n        if KubernetesApi.is_on_kubernetes():\n            on_kubernetes = True\n            kubernetes_api = KubernetesApi()\n            pods_info = kubernetes_api.get_pods()['items']\n            version = os.getenv('REPOSITORY', 'https://github.com/fossasia/open-event-orga-server.git')\n            commit_info = os.getenv('BRANCH', 'development')\n        else:\n            version = get_latest_heroku_release()\n            commit_info = None\n            commit_number = None\n            if version:\n                commit_number = version['description'].split(' ')[1]\n                commit_info = get_commit_info(commit_number)\n\n        return self.render('/gentelella/admin/super_admin/widgets/index.html',\n                           events=events,\n                           version=version,\n                           commit_info=commit_info,\n                           on_kubernetes=True,\n                           pods_info=pods_info,\n                           number_live_events=number_live_events,\n                           number_draft_events=number_draft_events,\n                           number_past_events=number_past_events,\n                           super_admins=super_admins,\n                           admins=admins,\n                           registered_users=registered_users,\n                           organizers=organizers,\n                           co_organizers=co_organizers,\n                           track_organizers=track_organizers,\n                           attendees=attendees,\n                           accepted_sessions=accepted_sessions,\n                           rejected_sessions=rejected_sessions,\n                           draft_sessions=draft_sessions,\n                           email_times=email_times)\n", "path": "app/views/admin/super_admin/super_admin.py"}]}