def do_reactivate_realm(realm: Realm) -> None:
    realm.deactivated = False
    realm.save(update_fields=['deactivated'])
    event_time = timezone_now()
    RealmAuditLog.objects.create(realm=realm, event_type=RealmAuditLog.REALM_REACTIVATED, event_time=event_time, extra_data=ujson.dumps({RealmAuditLog.ROLE_COUNT: realm_user_count_by_role(realm)}))
def do_reactivate_realm(realm: Realm) -> None:
    realm.deactivated = False
    realm.save(update_fields=['deactivated'])
    event_time = timezone_now()
    RealmAuditLog.objects.create(realm=realm, event_type=RealmAuditLog.REALM_REACTIVATED, event_time=event_time, extra_data=ujson.dumps({RealmAuditLog.ROLE_COUNT: realm_user_count_by_role(realm)}))