diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-08 02:27:05 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-08 02:27:05 -0500 |
commit | 5358639307915d53e62c0512de59655d8562bcc6 (patch) | |
tree | dd46fa78e427328d7cafdbf05bb455e19360b77f /server.py | |
parent | 054c197534c38fcfd39f57089d23af65f8458dd4 (diff) | |
download | bbj-5358639307915d53e62c0512de59655d8562bcc6.tar.gz |
rename db_sanity_check >> db_validate
Diffstat (limited to 'server.py')
-rw-r--r-- | server.py | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -298,7 +298,23 @@ class API(object): @api_method - def db_sanity_check(self, args, database, user, **kwargs): + def set_thread_pin(self, args, database, user, **kwargs): + """ + Requires the arguments `thread_id` and `pinned`. Pinned + must be a boolean of what the pinned status should be. + This method requires that the caller is logged in and + has admin status on their account. + + Returns the same boolean you supply as `pinned` + """ + validate(args, ["thread_id", "pinned"]) + if not user["is_admin"]: + raise BBJUserError("Only admins can set thread pins") + return db.set_thread_pin(database, args["thread_id"], args["pinned"]) + + + @api_method + def db_validate(self, args, database, user, **kwargs): """ Requires the arguments `key` and `value`. Returns an object with information about the database sanity criteria for |