#626 [frontend] don't display url to dist-git logs for non-admin users
Merged a year ago by praiskup. Opened a year ago by dturecek.
copr/ dturecek/copr hide-distgit-logs  into  master

@@ -759,11 +759,11 @@ 

      def id_fixed_width(self):

          return "{:08d}".format(self.id)

  

-     @property

-     def import_log_urls(self):

-         backend_log = self.import_log_url_backend

-         types = [helpers.BuildSourceEnum("upload"), helpers.BuildSourceEnum("link")]

-         return filter(None, [backend_log, self.import_log_url_distgit])

+     def get_import_log_urls(self, admin=False):

+         logs = [self.import_log_url_backend]

+         if admin:

+             logs.append(self.import_log_url_distgit)

+         return list(filter(None, logs))

  

      @property

      def import_log_url_distgit(self):

@@ -161,9 +161,9 @@ 

        <div class="panel-body">

          <dl class="dl-horizontal">

          {{ describe_failure(build) }}

-         <dt>Import logs:</dt>

+         <dt>Import log:</dt>

          <dd>

-           {% for url in build.import_log_urls %}

+           {% for url in build.get_import_log_urls(g.user.admin) %}

              <a href="{{ url }}">{{ url |basename }}</a>

              {{ "," if not loop.last }}

            {% endfor %}

no initial comment

Can you please return a list generator preferably, or list(filter(...))?

I'd propose to also s/Import logs:/Import log:.

rebased onto 62afaed3f2a00d84c596592e3a17cdf34251df60

a year ago

I've addressed both your comments.

rebased onto f811226

a year ago

Pull-Request has been merged by praiskup

a year ago