def expiration_notification(sender, **kwargs):
    """
    FIXME: Migrate it (txcron) to work with the String Level.
    """
    logger.debug("lock-addon: Sending expiration notifications...")
    if not settings.ENABLE_NOTICES:
        logger.debug("lock-addon: ENABLE_NOTICES is not enabled")
        return
    current_site = Site.objects.get_current()
    locks = Lock.objects.expiring()
    nt = 'project_resource_language_lock_expiring'
    for lock in locks:
        context = { 'resource': lock.rlstats.resource,
                    'language': lock.rlstats.language,
                    'project' : lock.rlstats.resource.project,
                    'user': lock.owner,
                    'expires': lock.expires,
                    'current_site' : current_site }
        logger.debug("lock-addon: Sending notification about lock: %s" % lock)
        notification.send_now([lock.owner,], nt, context)
        lock.notified = True
        lock.save()
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/addons/locks/handlers.py/expiration_notification/original