mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
do not allow casting on challenge tasks in v2
This commit is contained in:
@@ -657,6 +657,8 @@ api.cast = async function(req, res, next) {
|
||||
if (!task) {
|
||||
return res.status(404).json({err: 'Task "' + targetId + '" not found.'});
|
||||
}
|
||||
if (task.challenge.id) return res.status(40).json({err: 'Cannot cast spell on challenge task.'});
|
||||
|
||||
|
||||
spell.cast(user, task, req);
|
||||
await task.save();
|
||||
|
||||
Reference in New Issue
Block a user