Skip to content

Commit

Permalink
Accept unofficial submissions to ae by default
Browse files Browse the repository at this point in the history
Active elements with max submissions are put in a separate category
"active elements with max submissions" that doesn't accept unofficial
submisions by default. Closes #165
  • Loading branch information
lainets committed Jun 8, 2023
1 parent 42e16e2 commit 9fe39ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions directives/ae_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def run(self):
'category': 'active elements',
'max_submissions': self.options.get('submissions', data.get('max_submissions', env.config.ae_default_submissions)),
})
data["category"] = "active elements" if data["max_submissions"] == 0 else "active elements with max submissions"

data.setdefault('status', self.options.get('status', 'unlisted'))

self.apply_override(data, category)
Expand Down
4 changes: 4 additions & 0 deletions toc_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ def parse_chapter(docname, doc, parent, module_meta):
if key in categories:
categories[key]['status'] = 'nototal'

if "active elements" in categories:
categories["active elements"].setdefault("accept_unofficial_submits", True)

# Set unprotected paths
unprotected_paths = course_meta.get('unprotected-paths', app.config.unprotected_paths)
if isinstance(unprotected_paths, str):
unprotected_paths = shlex.split(unprotected_paths)
Expand Down

0 comments on commit 9fe39ca

Please sign in to comment.