mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
REFACTOR: Deprecate Discourse.Site
and Discourse.User
This commit is contained in:
@ -25,6 +25,7 @@ import { userPath } from "discourse/lib/url";
|
||||
import Category from "discourse/models/category";
|
||||
import { Promise } from "rsvp";
|
||||
import { getProperties } from "@ember/object";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
|
||||
export const SECOND_FACTOR_METHODS = {
|
||||
TOTP: 1,
|
||||
@ -901,4 +902,18 @@ User.reopenClass(Singleton, {
|
||||
}
|
||||
});
|
||||
|
||||
let warned = false;
|
||||
Object.defineProperty(Discourse, "User", {
|
||||
get() {
|
||||
if (!warned) {
|
||||
deprecated("Import the User class instead of using Discourse.User", {
|
||||
since: "2.4.0",
|
||||
dropFrom: "2.6.0"
|
||||
});
|
||||
warned = true;
|
||||
}
|
||||
return User;
|
||||
}
|
||||
});
|
||||
|
||||
export default User;
|
||||
|
Reference in New Issue
Block a user