improve historical campaign lookup

Move the "enabled" check to the db query

Change-Id: I9e3d38fcad39ee02eb4f264068328e16989471ae