import os

from django.core import checks
from django.contrib.staticfiles.finders import find

from .apps import RemindersConfig

@checks.register()
def voice_reminders_exist(app_configs, **kwargs):
    for x, _ in RemindersConfig.voice_reminders:
        if not find(os.path.join('mp3', x)):
            yield checks.Error(
                "Reminder recording missing: %r" % x,
                id='takeyourmeds.reminders.E001',
            )

Check that the MP3 files actually exist.
Check that the MP3 files actually exist.

Signed-off-by: Chris Lamb <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-lamb.co.uk>
