Skip to content

Commit

Permalink
fix: only broadcast active_generations for self or admin
Browse files Browse the repository at this point in the history
Previous to this change, users with `public_workers: true` would also broadcast this information. I am assuming this was an oversight and not intended.
  • Loading branch information
tazlin committed Jul 7, 2024
1 parent f15f608 commit 403042d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions horde/classes/base/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,6 @@ def get_details(self, details_privilege=0):
for worker in self.workers:
workers_array.append(str(worker.id))
ret_dict["worker_ids"] = workers_array
ret_dict["active_generations"] = {}
for wp in self.waiting_prompts:
if wp.wp_type not in ret_dict["active_generations"]:
ret_dict["active_generations"][wp.wp_type] = []
ret_dict["active_generations"][wp.wp_type].append(str(wp.id))
if details_privilege >= 1:
sharedkeys_array = []
for sk in self.sharedkeys:
Expand All @@ -874,6 +869,11 @@ def get_details(self, details_privilege=0):
ret_dict["contact"] = self.contact
ret_dict["vpn"] = self.vpn
ret_dict["special"] = self.special
ret_dict["active_generations"] = {}
for wp in self.waiting_prompts:
if wp.wp_type not in ret_dict["active_generations"]:
ret_dict["active_generations"][wp.wp_type] = []
ret_dict["active_generations"][wp.wp_type].append(str(wp.id))
if details_privilege >= 2:
mk_dict = {
"amount": self.calculate_monthly_kudos(),
Expand Down

0 comments on commit 403042d

Please sign in to comment.