diff --git a/swh/web/ui/backend.py b/swh/web/ui/backend.py --- a/swh/web/ui/backend.py +++ b/swh/web/ui/backend.py @@ -196,21 +196,10 @@ Information for the revision matching the criterions. """ - # Disable pending RemoteStorage opening revision_log_by - """ - if not ts and branch_name == 'refs/heads/master': - return main.storage().revision_log_by(origin_id) - """ - - rev = main.storage().revision_get_by(origin_id, - branch_name, - timestamp=ts, - limit=1) - if not rev: - return None - rev_sha1s_bin = [revision['id'] for revision in rev] - return main.storage().revision_log(rev_sha1s_bin, limit) + return main.storage().revision_log_by(origin_id, + branch_name, + ts) def stat_counters(): diff --git a/swh/web/ui/templates/upload_and_search.html b/swh/web/ui/templates/upload_and_search.html --- a/swh/web/ui/templates/upload_and_search.html +++ b/swh/web/ui/templates/upload_and_search.html @@ -49,13 +49,13 @@ value="" style="display:none" placeholder="File(s) to upload, hash and search for SHA-1 or SHA-256 checksum" /> - {% if search_stats is not none and search_stats %} + {% if search_res is not none %} + {% if search_stats is not none %} {% endif %} - {% if search_res is not none %} @@ -80,12 +80,8 @@ {% endfor %}
File name
{% endif %} - {% if messages is not none and messages %} -
- {% for message in messages %} -
+ {% if message is not none %}
{{ message | safe }}
- {% endfor %}
{% endif %} diff --git a/swh/web/ui/tests/test_backend.py b/swh/web/ui/tests/test_backend.py --- a/swh/web/ui/tests/test_backend.py +++ b/swh/web/ui/tests/test_backend.py @@ -456,7 +456,6 @@ @istest def revision_log_by(self): # given - # given sha1_bin = hashutil.hex_to_hash( '28d8be353ed3480476f032475e7c233eff7371d5') stub_revision_log = [{ @@ -482,9 +481,8 @@ 'metadata': [], }] - self.storage.revision_get_by = MagicMock(return_value=[ - {'id': sha1_bin}]) - self.storage.revision_log = MagicMock(return_value=stub_revision_log) + self.storage.revision_log_by = MagicMock( + return_value=stub_revision_log) # when actual_log = backend.revision_log_by(1, 'refs/heads/master', None) @@ -496,11 +494,10 @@ @istest def revision_log_by_norev(self): # given - # given sha1_bin = hashutil.hex_to_hash( '28d8be353ed3480476f032475e7c233eff7371d5') - self.storage.revision_get_by = MagicMock(return_value=None) + self.storage.revision_log_by = MagicMock(return_value=None) # when actual_log = backend.revision_log_by(1, 'refs/heads/master', None)