*:' NoneType'不支持的操作数类型和' int'

时间:2016-11-04 12:13:18

标签: django python-2.7

我有一个接收节目指南的代码。

class ProgramList(UseSlaveMixin, TvmiddlewareApiView):
@method_decorator(auth_required)
def get(self, request, params):
    print params.tariffs
    channel = self.channel
    maintenances = self.get_maintances()
    timestamp_from, timestamp_to = self.get_filters()
    epg = self.get_epg(channel.epg_channel_id, timestamp_from, timestamp_to)

    utc_date = datetime.datetime.utcnow()
    utc_timestamp = int((utc_date - datetime.datetime(1970, 1, 1)).total_seconds())
    max_archive_duration_days = channel.max_archive_duration(params)
    archive_start_time = (utc_timestamp - (max_archive_duration_days * 3600 * 24))
    has_npvr_service = False

    items = {'error': 0, 'programs': []}

我试图获得结果并收到:

archive_start_time = (utc_timestamp - (max_archive_duration_days * 3600 * 24))

但是我收到了这个错误:

TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

0 个答案:

没有答案