# Trust level trigger is called before trust level is changed

**URL:** <https://meta.discourse.org/t/trust-level-trigger-is-called-before-trust-level-is-changed/275614>\
**Category:** Bug\
**Created:** [August 17, 2023, 8:37pm UTC](https://meta.discourse.org/t/trust-level-trigger-is-called-before-trust-level-is-changed/275614 "2023-08-17T20:37:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [August 17, 2023, 8:37pm UTC](https://meta.discourse.org/t/trust-level-trigger-is-called-before-trust-level-is-changed/275614/1 "2023-08-17T20:37:08Z")

</div>

I’m working on an additive trust level plugin that adds/deletes from a group depending on membership on a set of other groups (e.g., membership in `paid` and `special` also gets you into the `paid-special` group).

It’s very strange that TL promotions will trigger an `:after_save` event, but TL demotions do not trigger a `:after_destroy` event, but I’m working around that with `DiscourseEvent.on(:user_promoted)`

But that doesn’t work because the trigger gets called before the trust level is updated:

> <https://github.com/discourse/discourse/blob/main/lib/promotion.rb#L89-L95>

I submitted a PR: [https://github.com/pfaffman/discourse/pull/205](https://github.com/pfaffman/discourse/pull/205)
