import mandrill
from django.conf import settings

MAIL_CLIENT = None

from typing import Optional

def get_mandrill_client():
    # type: () -> Optional[mandrill.Mandrill]
    if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
        return None

    global MAIL_CLIENT
    if not MAIL_CLIENT:
        MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)

    return MAIL_CLIENT


import mandrill
from django.conf import settings

MAIL_CLIENT = None

from typing import Optional

def get_mandrill_client():
    # type: () -> Optional[mandrill.Mandrill]
    if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
        return None

    global MAIL_CLIENT
    if not MAIL_CLIENT:
        MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)

    return MAIL_CLIENT


Fix hardcoded check for settings.VOYAGER.
mandrill: Fix hardcoded check for settings.VOYAGER.

Since this delayed sending feature is the only thing
settings.MANDRILL_API_KEY is used for, it seems reasonable for that to
be the gate as to whether we actually use Mandrill.

  import mandrill
  from django.conf import settings
  
  MAIL_CLIENT = None
  
  from typing import Optional
  
  def get_mandrill_client():
      # type: () -> Optional[mandrill.Mandrill]
-     if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
+     if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
          return None
  
      global MAIL_CLIENT
      if not MAIL_CLIENT:
          MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)
  
      return MAIL_CLIENT
  
  
Fix hardcoded check for settings.VOYAGER.
## Code Before:
import mandrill
from django.conf import settings

MAIL_CLIENT = None

from typing import Optional

def get_mandrill_client():
    # type: () -> Optional[mandrill.Mandrill]
    if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT or settings.VOYAGER:
        return None

    global MAIL_CLIENT
    if not MAIL_CLIENT:
        MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)

    return MAIL_CLIENT


## Instruction:
Fix hardcoded check for settings.VOYAGER.
## Code After:
import mandrill
from django.conf import settings

MAIL_CLIENT = None

from typing import Optional

def get_mandrill_client():
    # type: () -> Optional[mandrill.Mandrill]
    if settings.MANDRILL_API_KEY == '' or settings.DEVELOPMENT:
        return None

    global MAIL_CLIENT
    if not MAIL_CLIENT:
        MAIL_CLIENT = mandrill.Mandrill(settings.MANDRILL_API_KEY)

    return MAIL_CLIENT

