From 7252b221a88a9c2bbfb7d959e010b4d3547e5c2d Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Jan 15 2018 04:37:34 +0000 Subject: update updates2stable make updates2stable only show on stream page, and link it to the user of the stream, rather than a config value. --- diff --git a/hubs/widgets/workflow/updates2stable.py b/hubs/widgets/workflow/updates2stable.py index 8ac3ae0..4e1bf95 100644 --- a/hubs/widgets/workflow/updates2stable.py +++ b/hubs/widgets/workflow/updates2stable.py @@ -19,15 +19,7 @@ class Updates2Stable(Widget): label = 'Updates Ready for Stable' position = "right" hidden_if_empty = True - parameters = [ - dict( - name="username", - label="Username", - default=None, - validator=validators.Username, - help="A FAS username.", - )] - + hub_types = ['stream'] class BaseView(RootWidgetView): @@ -36,7 +28,7 @@ class BaseView(RootWidgetView): def get_context(self, instance, *args, **kwargs): get_pending = GetPending(instance) context = dict( - username=instance.config["username"], + username = instance.hub.name, ) context.update(get_pending()) return context @@ -51,7 +43,7 @@ def parse_nvr(nvr): class GetPending(CachedFunction): def execute(self): - username = self.instance.config["username"] + username = self.instance.hub.name # First, get all of my updates currently in testing. bodhiurl = 'https://bodhi.fedoraproject.org/updates/' query = '?user={username}&status=testing'.format(username=username) @@ -88,7 +80,7 @@ class GetPending(CachedFunction): if not message['topic'].endswith('bodhi.update.comment'): return False if giveaway in message['msg']['comment']['text']: - username = self.instance.config['username'] + username = self.instance.hub.name if username == message['msg']['comment']['update_submitter']: return True return False