def METHOD_NAME(self, *args, **options):
    """
    Handler for the command
    It performs checks for username, course and enrollment validity and
    then calls update_deadline for the given arguments
    """
    username = options['username']
    course_id = options['course_key']
    try:
        user = User.objects.get(username=username)
    except User.DoesNotExist:
        logger.exception(f'Invalid or non-existent username {username}')
        raise
    try:
        course_key = CourseKey.from_string(course_id)
        CourseEnrollment.objects.get(user=user, course_id=course_key, mode=CourseMode.CREDIT_MODE)
    except InvalidKeyError:
        logger.exception(f'Invalid or non-existent course id {course_id}')
        raise
    except CourseEnrollment.DoesNotExist:
        logger.exception('No enrollment found in database for {username} in course {course_id}'
                         .format(username=username, course_id=course_id))
        raise
    try:
        expected_date = datetime.strptime(options['deadline'], '%Y-%m-%d')
        current_date = datetime.utcnow()
        if expected_date < current_date:
            raise IncorrectDeadline('Incorrect Deadline')
    except (TypeError, KeyError, IncorrectDeadline):
        logger.warning('Invalid date or date not provided. Setting deadline to one month from now')
        expected_date = datetime.utcnow() + timedelta(days=DEFAULT_DAYS)
    self.update_credit_eligibility_deadline(username, course_key, expected_date)
    logger.info(f"Successfully updated credit eligibility deadline for {username}")