Skip to content

Commit 2478709

Browse files
committed
fix: Fix bug when editing dataset
1 parent d62db9f commit 2478709

File tree

6 files changed

+33
-31
lines changed

6 files changed

+33
-31
lines changed

app/modules/dataset/templates/dataset/create_and_edit_dataset.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,9 +400,12 @@ <h4 class="alert-heading"><i class="align-middle" data-feather="alert-triangle">
400400

401401
{% block scripts %}
402402

403+
{% if not is_edit %}
403404
<script>
404405
let hubfiles = {{ hubfiles|tojson|safe }};
405406
</script>
407+
{% endif %}
408+
406409

407410
<script src="{{ url_for('zenodo.assets', subfolder='js', filename='scripts.js') }}"></script>
408411
<script src="{{ url_for('dataset.assets', subfolder='js', filename='scripts.js') }}"></script>

app/modules/dataset/templates/dataset/view_dataset.html

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -335,22 +335,6 @@ <h4 style="margin-bottom: 0px;"><span class="badge bg-dark">{{ dataset.count_fea
335335
<i data-feather="tag"></i> Fact Label
336336
</button>
337337

338-
<div class="btn-group" role="group">
339-
<button id="btnGroupDrop{{ file.id }}" type="button" class="btn btn-outline-primary btn-sm dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" style=" border-radius: 5px;">
340-
<i data-feather="check"></i> Check
341-
</button>
342-
<ul class="dropdown-menu" aria-labelledby="btnGroupDrop{{ file.id }}">
343-
<li>
344-
<a class="dropdown-item" onclick="checkUVL('{{ file.id }}')">Syntax check</a>
345-
</li>
346-
<!--
347-
<li>
348-
<a class="dropdown-item" onclick="checkSAT('{{ file.id }}')">SAT validity check</a>
349-
</li>
350-
-->
351-
</ul>
352-
</div>
353-
354338
<button onclick="addToCart('{{ file.id }}')" class="btn btn-outline-secondary btn-sm" style="border-radius: 5px;">
355339
<i data-feather="plus"></i> <i data-feather="download"></i> Add
356340
</button>

app/static/css/app.css

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/static/css/own.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,11 @@
197197
overflow: hidden;
198198
text-overflow: ellipsis;
199199
}
200+
201+
a{
202+
color: #147ABB;
203+
}
204+
205+
.bg-primary{
206+
background-color: #147ABB !important;
207+
}

app/static/js/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/redis/worker.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
import logging
2-
from rq import Worker, Queue, Connection
2+
from rq import Worker, Queue
33
from dotenv import load_dotenv
44
from app import create_app
55

6+
# Load environment variables
67
load_dotenv()
7-
logger = logging.getLogger(__name__)
8-
98

10-
if __name__ == '__main__':
9+
# Configure logger
10+
logger = logging.getLogger(__name__)
1111

12+
if __name__ == "__main__":
13+
# Create Flask application and load configuration
1214
app = create_app()
1315

1416
with app.app_context():
17+
# Create Flask application and load configuration
18+
redis_connection = app.config["SESSION_REDIS"]
19+
20+
# Define the queues to be listened to
21+
listen = ["default"]
1522

16-
# Connect to Redis and start listening to the queue
17-
listen = ['default']
18-
conn = app.config['SESSION_REDIS']
23+
# Create queue list
24+
queues = [Queue(name, connection=redis_connection) for name in listen]
1925

20-
with Connection(conn):
21-
worker = Worker(list(map(Queue, listen)))
22-
worker.work()
26+
# Initialise the worker
27+
logger.info(f"Starting worker for queues: {listen}")
28+
worker = Worker(queues)
29+
worker.work()

0 commit comments

Comments
 (0)