Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
zardus committed Jan 23, 2024
1 parent b629caa commit e783ab9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dojo_plugin/api/v1/dojo.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ class PruneAwards(Resource):
@dojo_admin
def post(self, dojo):
all_completions = set(user for user,_ in dojo.completions())
print(all_completions)
num_pruned = 0
for award in Emojis.query.where(Emojis.category==dojo.reference_id):
if award.user not in all_completions:
print(award)
num_pruned += 1
db.session.delete(award)
db.session.commit()
return {"success": True}
return {"success": True, "pruned_awards": num_pruned}

@dojo_namespace.route("/<dojo>/promote-admin")
class PromoteAdmin(Resource):
Expand Down

0 comments on commit e783ab9

Please sign in to comment.