aboutsummaryrefslogtreecommitdiffstats
path: root/server.py
diff options
context:
space:
mode:
authorBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-08 02:27:05 -0500
committerBlake DeMarcy <ofunknowndescent@gmail.com>2017-04-08 02:27:05 -0500
commit5358639307915d53e62c0512de59655d8562bcc6 (patch)
treedd46fa78e427328d7cafdbf05bb455e19360b77f /server.py
parent054c197534c38fcfd39f57089d23af65f8458dd4 (diff)
downloadbbj-5358639307915d53e62c0512de59655d8562bcc6.tar.gz
rename db_sanity_check >> db_validate
Diffstat (limited to 'server.py')
-rw-r--r--server.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/server.py b/server.py
index 7e652f8..69d295a 100644
--- a/server.py
+++ b/server.py
@@ -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
Un proyecto texto-plano.xyz