def enable_notifications(user):
 UserPreference.objects.get_or_create(user=user, key=NOTIFICATION_PREF_KEY, defaults={'value': UsernameCipher.encrypt(user.username)})

def enable_notifications ( user ) : UserPreference . objects . get_or_create ( user = user , key = NOTIFICATION_PREF_KEY , defaults = { 'value' : UsernameCipher . encrypt ( user . username ) } )
enable notifications for a user .