from django import template

register = template.Library()

@register.filter(name='safe_get')
def safe_get(dictionary, key):
    """Safely get a value from a dictionary, returning empty string if key doesn't exist"""
    if dictionary and key in dictionary:
        return dictionary[key]
    return ""
