Skip to content

Commit 67fc7c3

Browse files
committed
feature OK, user sub sent to queue from group
1 parent a85e0f8 commit 67fc7c3

File tree

4 files changed

+6
-28
lines changed

4 files changed

+6
-28
lines changed

src/apps/competitions/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Competition(models.Model):
5959
CustomGroup,
6060
blank=True,
6161
related_name='competitions',
62-
verbose_name="Groupes de participants",
62+
verbose_name="group of participants",
6363
help_text="Competition owner being able to create groups of users."
6464
)
6565

src/apps/competitions/tasks.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,9 @@
116116
]
117117
MAX_EXECUTION_TIME_LIMIT = int(os.environ.get('MAX_EXECUTION_TIME_LIMIT', 600)) # time limit of the default queue
118118

119-
import sys
120-
import os
121-
122119
def _send_to_compute_worker(submission, is_scoring):
123-
print("CONTAINER CHECK PID=", os.getpid(), flush=True)
124-
sys.stderr.write("STDERR TEST\n")
125-
sys.stderr.flush()
126-
127-
print("STDOUT TEST", flush=True)
128-
129-
logger.error("LOGGER ERROR TEST")
120+
logger.info("Site Worker ==> STARTING")
130121

131-
logger.warning("ZZZZ _send_to_compute_worker called")
132122
run_args = {
133123
"user_pk": submission.owner.pk,
134124
"submissions_api_url": settings.SUBMISSIONS_API_URL,
@@ -212,10 +202,6 @@ def _send_to_compute_worker(submission, is_scoring):
212202
time_padding = 60 * 20 # 20 minutes
213203
time_limit = submission.phase.execution_time_limit + time_padding
214204

215-
print("DJANGO VIEW REACHED", flush=True)
216-
logger.warning("test Avant try")
217-
218-
219205
try:
220206
competition = submission.phase.competition
221207

@@ -242,6 +228,8 @@ def _send_to_compute_worker(submission, is_scoring):
242228
if group.queue:
243229
run_args["queue"] = group.queue.name
244230
competition.queue = group.queue
231+
logger.info(f"Group Found = {group.name}")
232+
245233
else:
246234
logger.debug(
247235
"Submission %s owner %s: no intersection between user's groups %s and competition %s participant_groups",

src/settings/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,6 @@
326326
# =============================================================================
327327
# Logging
328328
# =============================================================================
329-
import sys
330-
331329
LOGGING_CONFIG = None
332330

333331
LOGGING = {

src/static/riot/competitions/editor/_participation.tag

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
self.editing_group = null
154154
self._scheduledUpdate = false
155155

156-
// init semantic UI elements + setup multi-select behaviour
157156
const initUI = () => {
158157
try { $('.ui.checkbox', self.root).checkbox() } catch(e) {}
159158
try { $('.ui.dropdown', self.root).dropdown() } catch(e) {}
@@ -220,7 +219,6 @@
220219
self.markdown_editor = create_easyMDE(self.refs.terms)
221220
self.markdown_editor_whitelist = create_easyMDE(self.refs.whitelist_emails, false, false, '200px')
222221

223-
// Si un event competition_loaded est arrivé avant le mount, l'appliquer maintenant
224222
try {
225223
if (self._pending_competition && self._pending_competition.terms) {
226224
try {
@@ -408,7 +406,6 @@
408406
try { $(self.refs.group_modal).modal('hide') } catch(e) { self.refs.group_modal.style.display = 'none' }
409407
}
410408

411-
// submit create / update group (Form POST instead of JSON)
412409
self.submit_group = () => {
413410
const name = (self.refs.group_name && self.refs.group_name.value || '').trim()
414411
if (!name) {
@@ -446,7 +443,6 @@
446443
let url = '/competitions/' + pk + '/groups/create/'
447444
if (self.editing_group && self.editing_group.id) url = '/competitions/' + pk + '/groups/' + self.editing_group.id + '/update/'
448445

449-
// Build FormData (classic Django POST format)
450446
const form = new FormData()
451447
form.append('name', name)
452448
if (queue_id) form.append('queue_id', queue_id)
@@ -500,14 +496,12 @@
500496
})
501497
}
502498

503-
// delete group (POST form-style)
504499
self.delete_group = (group) => {
505500
if (!confirm('Supprimer le groupe "' + group.name + '" ?')) return
506501
const pk = compPk()
507502
if (!pk) return
508503
const url = '/competitions/' + pk + '/groups/' + group.id + '/delete/'
509504

510-
// Use an empty FormData (server only expects POST; no body required but consistent)
511505
const form = new FormData()
512506
form.append('dummy', '1')
513507

@@ -522,7 +516,6 @@
522516
if (!resp.ok) throw resp
523517
return resp.json()
524518
}).then(data => {
525-
// remove from UI
526519
self.available_groups = self.available_groups.filter(x => x.id !== group.id)
527520
self.selected_group_ids = self.selected_group_ids.filter(x => x !== group.id)
528521

@@ -544,7 +537,6 @@
544537
}
545538
} catch(e){ console.warn('setting checkboxes failed', e) }
546539

547-
// Si l'éditeur est prêt, appliquer tout de suite, sinon stocker en attente pour mount
548540
try {
549541
if (self.markdown_editor && self.markdown_editor.codemirror && typeof self.markdown_editor.codemirror.refresh === 'function') {
550542
try {
@@ -558,9 +550,9 @@
558550
} catch(e){ console.warn('apply competition_loaded to editors failed', e) }
559551
return
560552
}
561-
} catch(e){ /* ignore */ }
553+
} catch(e){
554+
}
562555

563-
// stocker la compétition pour l'appliquer lorsque mount aura créé les éditeurs
564556
self._pending_competition = competition
565557
})
566558

0 commit comments

Comments
 (0)