# Buggy code
def import_task_choice_event(self, session, task):
    skip_queries = self.config["skip"].as_str_seq()
    warn_queries = self.config["warn"].as_str_seq()

    if task.choice_flag == action.APPLY:
        if skip_queries or warn_queries:
            self._log.debug("[ihate] processing your hate")
            if self.do_i_hate_this(task, skip_queries):
                task.choice_flag = action.SKIP
                self._log.info(
                    "[ihate] skipped: {0} - {1}".format(task.cur_artist, task.cur_album)
                )
                return
            if self.do_i_hate_this(task, warn_queries):
                self._log.info(
                    "[ihate] you maybe hate this: {0} - {1}".format(
                        task.cur_artist, task.cur_album
                    )
                )
        else:
            self._log.debug("[ihate] nothing to do")
    else:
        self._log.debug("[ihate] user made a decision, nothing to do")


# Traceback (AttributeError)
Traceback (most recent call last):
File "/usr/local/bin/beet", line 8, in <module>
load_entry_point('beets==1.3.0', 'console_scripts', 'beet')()
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/ui/__init__.py", line 776, in main
_raw_main(args)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/ui/__init__.py", line 768, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/ui/commands.py", line 845, in import_func
import_files(lib, paths, query)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/ui/commands.py", line 783, in import_files
session.run()
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/importer.py", line 341, in run
pl.run_parallel(QUEUE_SIZE)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/util/pipeline.py", line 243, in run
out = self.coro.send(msg)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/importer.py", line 952, in item_query
plugins.send('import_task_choice', session=session, task=task)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beets/plugins.py", line 372, in send
handler(**arguments)
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beetsplug/ihate.py", line 104, in import_task_choice_event
self.config['skip_whitelist'].as_str_seq()):
File "/Library/Python/2.7/site-packages/beets-1.3.0-py2.7.egg/beetsplug/ihate.py", line 79, in do_i_hate_this
if not hate and task.cur_album and album_patterns:
AttributeError: 'ImportTask' object has no attribute 'cur_album'

# Fixed code
def import_task_choice_event(self, session, task):
    skip_queries = self.config["skip"].as_str_seq()
    warn_queries = self.config["warn"].as_str_seq()

    if task.choice_flag == action.APPLY:
        if skip_queries or warn_queries:
            self._log.debug("[ihate] processing your hate")
            if self.do_i_hate_this(task, skip_queries):
                task.choice_flag = action.SKIP
                self._log.info("[ihate] skipped: {0}".format(summary(task)))
                return
            if self.do_i_hate_this(task, warn_queries):
                self._log.info("[ihate] you maybe hate this: {0}".format(summary(task)))
        else:
            self._log.debug("[ihate] nothing to do")
    else:
        self._log.debug("[ihate] user made a decision, nothing to do")