def is_satisfied_by(self, *args, **kwargs): user_data = kwargs.get("user_data", None) if user_data is None: return False user_id = user_data.user_id promo_avatar = ProfileCustomizationBadge._PROMO_NAME_AVATAR promo_display_case = ProfileCustomizationBadge._PROMO_NAME_DISPLAY_CASE return (PromoRecord.has_user_seen_promo(promo_avatar, user_id) and PromoRecord.has_user_seen_promo(promo_display_case, user_id))
def mark_display_case_filled(user_data): """ Marks a user as filled her displaycase. Returns whether or not they should achieve a ProfileCustomizationBadge after this action. """ changed = PromoRecord.record_promo( ProfileCustomizationBadge._PROMO_NAME_DISPLAY_CASE, user_data.user_id) return changed and PromoRecord.has_user_seen_promo( ProfileCustomizationBadge._PROMO_NAME_AVATAR, user_data.user_id)