@receiver(site_options_called, sender=None)
def handler_views_was_called(**kwargs):
    options = {}
    opts = SiteOptions.objects.filter(key__startswith='zorna_')
    for opt in opts:
        options[opt.key] = opt
    for k, o in SITES_OPTIONS.iteritems():
        if k in options:
            if options[k].option != o:
                options[k].option = o
                options[k].save()
            del options[k]
        else:
            opt = SiteOptions(option=o, key=k)
            opt.save()
    if len(options):
        SiteOptions.objects.filter(pk__in=[
                                   opt.pk for opt in options.values()]).delete()
dataset/ETHPy150Open zorna/zorna/zorna/site/models.py/handler_views_was_called/original