SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 6a500548 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Add management command to check submission metadata correctness

parent ebbade4b
No related branches found
No related tags found
No related merge requests found
__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
import traceback
from django.core.management.base import BaseCommand
from submissions.models import Submission
class Command(BaseCommand):
"""Verify the metadata formatting and flag errors."""
def handle(self, *args, **kwargs):
for sub in Submission.objects.all():
# Check that the author list is properly formatted
try:
if True or 'entries' in sub.metadata:
author_str_list = [
a['name'].split()[-1] for a in sub.metadata['entries'][0]['authors']]
except:
print('Error for %s' % sub.preprint)
traceback.print_exc()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment