SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SciPost
SciPost
Commits
ebd5b883
Commit
ebd5b883
authored
6 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Add AlternativeEmail
parent
d3d4a083
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
profiles/migrations/0003_auto_20180930_0726.py
+34
-0
34 additions, 0 deletions
profiles/migrations/0003_auto_20180930_0726.py
profiles/models.py
+14
-1
14 additions, 1 deletion
profiles/models.py
with
48 additions
and
1 deletion
profiles/migrations/0003_auto_20180930_0726.py
0 → 100644
+
34
−
0
View file @
ebd5b883
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-09-30 05:26
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
profiles
'
,
'
0002_auto_20180916_1643
'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'
AlternativeEmail
'
,
fields
=
[
(
'
id
'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
email
'
,
models
.
EmailField
(
max_length
=
254
)),
(
'
still_valid
'
,
models
.
BooleanField
(
default
=
True
)),
],
),
migrations
.
AlterField
(
model_name
=
'
profile
'
,
name
=
'
email
'
,
field
=
models
.
EmailField
(
max_length
=
254
),
),
migrations
.
AddField
(
model_name
=
'
alternativeemail
'
,
name
=
'
profile
'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'
profiles.Profile
'
),
),
]
This diff is collapsed.
Click to expand it.
profiles/models.py
+
14
−
1
View file @
ebd5b883
...
...
@@ -36,7 +36,7 @@ class Profile(models.Model):
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
)
email
=
models
.
EmailField
()
discipline
=
models
.
CharField
(
max_length
=
20
,
choices
=
SCIPOST_DISCIPLINES
,
default
=
DISCIPLINE_PHYSICS
,
verbose_name
=
'
Main discipline
'
)
expertises
=
ChoiceArrayField
(
...
...
@@ -54,3 +54,16 @@ class Profile(models.Model):
def
__str__
(
self
):
return
'
%s, %s %s
'
%
(
self
.
last_name
,
self
.
get_title_display
(),
self
.
first_name
)
class
AlternativeEmail
(
models
.
Model
):
"""
It is often the case that somebody has multiple email addresses.
The
'
email
'
field of a given Profile, Contributor or other person-based object
is then interpreted as representing the current address.
An AlternativeEmail is bound to a Profile and holds info on eventual
secondary email addresses.
"""
profile
=
models
.
ForeignKey
(
Profile
,
on_delete
=
models
.
CASCADE
)
email
=
models
.
EmailField
()
still_valid
=
models
.
BooleanField
(
default
=
True
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment