Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
__copyright__ = "Copyright 2016-2018, Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django.db import models
from scipost.behaviors import orcid_validator
from scipost.constants import (
TITLE_CHOICES,
SCIPOST_DISCIPLINES, DISCIPLINE_PHYSICS,
SCIPOST_SUBJECT_AREAS,
)
from scipost.fields import ChoiceArrayField
class Profile(models.Model):
"""
A Profile object instance contains information about an individual
who is a potential SciPost Contributor but is not necessarily registered.
It is created and used by Admin, EdAdmin or other internal SciPost staff.
For registered Contributors, a profile is initially created from the contributor-filled
information in the Contributor object. Profile should thus be viewed as containing
the Admin-certified version of this information.
The information is only partial, and is meant to be used among others to:
#. help with editorial matters:
#. help EdAdmin identify prospective Fellows
#. help Fellows identify appropriate referees
#. mark potential conflicts of interest
#. allow respecting people's preferences:
#. mark somebody as not willing to receive emails from SciPost.
#. mark somebody as a non-referee (if that person does not want to referee for SciPost)
"""
title = models.CharField(max_length=4, choices=TITLE_CHOICES)
first_name = models.CharField(max_length=64)
last_name = models.CharField(max_length=64)
email = models.EmailField(unique=True)
discipline = models.CharField(max_length=20, choices=SCIPOST_DISCIPLINES,
default=DISCIPLINE_PHYSICS, verbose_name='Main discipline')
expertises = ChoiceArrayField(
models.CharField(max_length=10, choices=SCIPOST_SUBJECT_AREAS),
blank=True, null=True)
orcid_id = models.CharField(max_length=20, verbose_name="ORCID id",
blank=True, validators=[orcid_validator])
webpage = models.URLField(blank=True)
# Preferences for interactions with SciPost:
accepts_SciPost_emails = models.BooleanField(default=True)
accepts_refereeing_requests = models.BooleanField(default=True)
class Meta:
ordering = ['last_name']
def __str__(self):
return '%s, %s %s' % (self.last_name, self.get_title_display(), self.first_name)