diff --git a/scipost/managers.py b/scipost/managers.py index 518ca5aaf34d411d1ab3cde65c4a5023b9a7b1df..2276fc60f2fcda6aad2f612d5b7888bda2f16b2b 100644 --- a/scipost/managers.py +++ b/scipost/managers.py @@ -3,7 +3,7 @@ import datetime from django.db import models from django.db.models import Q -from .constants import CONTRIBUTOR_NORMAL +from .constants import CONTRIBUTOR_NORMAL, INVITATION_EDITORIAL_FELLOW class FellowManager(models.Manager): @@ -20,3 +20,13 @@ class FellowManager(models.Manager): class ContributorManager(models.Manager): def active(self): return self.filter(user__is_active=True, status=CONTRIBUTOR_NORMAL) + + +class RegistrationInvitationManager(models.Manager): + def pending_invited_fellows(self): + return self.filter(invitation_type=INVITATION_EDITORIAL_FELLOW, + responded=False, declined=False) + + def declined_invited_fellows(self): + return self.filter(invitation_type=INVITATION_EDITORIAL_FELLOW, + responded=False, declined=True) diff --git a/scipost/models.py b/scipost/models.py index d8a4d015c2ad35650c0c263d079748bb33b25bd0..1e1ad810c17d43ca3a426af83b0e6c96498be911 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -19,7 +19,7 @@ from .constants import SCIPOST_DISCIPLINES, SCIPOST_SUBJECT_AREAS,\ INVITATION_CONTRIBUTOR, INVITATION_FORMAL,\ AUTHORSHIP_CLAIM_PENDING, AUTHORSHIP_CLAIM_STATUS from .fields import ChoiceArrayField -from .managers import FellowManager, ContributorManager +from .managers import FellowManager, ContributorManager, RegistrationInvitationManager def get_sentinel_user(): @@ -184,7 +184,7 @@ class Remark(models.Model): recommendation = models.ForeignKey('submissions.EICRecommendation', on_delete=models.CASCADE, blank=True, null=True) - date = models.DateTimeField() + date = models.DateTimeField(auto_now_add=True) remark = models.TextField() def __str__(self): @@ -261,6 +261,11 @@ class RegistrationInvitation(models.Model): responded = models.BooleanField(default=False) declined = models.BooleanField(default=False) + objects = RegistrationInvitationManager() + + class Meta: + ordering = ['last_name'] + def __str__(self): return (self.first_name + ' ' + self.last_name + ' on ' + self.date_sent.strftime("%Y-%m-%d")) diff --git a/scipost/services.py b/scipost/services.py index 7a6707e8f7b84fab44f80726a0046724ed38bd23..9e61ccd731882f140a3095e7d0b7dfb786250892 100644 --- a/scipost/services.py +++ b/scipost/services.py @@ -1,15 +1,9 @@ # Module for making external api calls as needed in the submissions cycle import feedparser import requests -import re import datetime import dateutil.parser -from django.template import Template, Context -from .behaviors import ArxivCallable - -from strings import arxiv_caller_errormessages - class DOICaller: def __init__(self, doi_string): diff --git a/scipost/static/scipost/assets/css/_type.scss b/scipost/static/scipost/assets/css/_type.scss index 4a6abda1d9c5380bede218901fcece7c031ae3c9..47d2ee08d44b92cdecbbf268576a6b3f2bcc1ea4 100644 --- a/scipost/static/scipost/assets/css/_type.scss +++ b/scipost/static/scipost/assets/css/_type.scss @@ -92,6 +92,7 @@ hr.hr12 { margin-bottom: 1rem; border-radius: 99px; box-shadow: 0 1px 0 0 #d3e3f6; + width: 100%; &.small { height: 1px; diff --git a/scipost/templatetags/scipost_extras.py b/scipost/templatetags/scipost_extras.py index 9d986151422282a9584badaa48daeb3dfb308f39..25c81e2b02c48f6bed015b8762147284b36d828e 100644 --- a/scipost/templatetags/scipost_extras.py +++ b/scipost/templatetags/scipost_extras.py @@ -1,7 +1,6 @@ from django import template -from django.contrib.auth.models import Group -from ..constants import subject_areas_dict +from ..constants import subject_areas_dict, subject_areas_raw_dict from ..models import Contributor register = template.Library() @@ -15,6 +14,7 @@ register = template.Library() def sort_by(queryset, order): return queryset.order_by(order) + @register.filter(name='duration') def duration(dur): total_seconds = int(dur.total_seconds())