Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
32
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
BDE
nk20
Commits
e66d4612
Unverified
Commit
e66d4612
authored
5 years ago
by
me5na7qbjqbrp
Browse files
Options
Downloads
Patches
Plain Diff
Fix adh migration
parent
9d56b6ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Make the ci pass
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
adherents/migrations/0001_initial.py
+8
-2
8 additions, 2 deletions
adherents/migrations/0001_initial.py
adherents/models.py
+5
-13
5 additions, 13 deletions
adherents/models.py
with
13 additions
and
15 deletions
adherents/migrations/0001_initial.py
+
8
−
2
View file @
e66d4612
# Generated by Django 2.2.3 on 2019-07-
08 11:48
# Generated by Django 2.2.3 on 2019-07-
16 07:17
from
django.conf
import
settings
from
django.db
import
migrations
,
models
...
...
@@ -18,8 +18,14 @@ class Migration(migrations.Migration):
name
=
'
Profile
'
,
fields
=
[
(
'
id
'
,
models
.
AutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'
ID
'
)),
(
'
phone_number
'
,
models
.
CharField
(
max_length
=
255
,
verbose_name
=
'
phone number
'
)),
(
'
avatar
'
,
models
.
ImageField
(
blank
=
True
,
max_length
=
255
,
upload_to
=
''
,
verbose_name
=
'
profile picture
'
)),
(
'
phone_number
'
,
models
.
CharField
(
blank
=
True
,
default
=
''
,
max_length
=
50
,
null
=
True
,
verbose_name
=
'
phone number
'
)),
(
'
section
'
,
models
.
CharField
(
help_text
=
'
e.g.
"
1A0
"
,
"
9A♥
"
,
"
SAPHIRE
"'
,
max_length
=
255
,
verbose_name
=
'
section
'
)),
(
'
genre
'
,
models
.
CharField
(
blank
=
True
,
choices
=
[(
None
,
'
ND
'
),
(
'
M
'
,
'
M
'
),
(
'
F
'
,
'
F
'
)],
max_length
=
1
,
null
=
True
)),
(
'
address
'
,
models
.
TextField
(
blank
=
True
,
null
=
True
)),
(
'
paid
'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
paid
'
)),
(
'
is_active
'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'
is active
'
)),
(
'
is_deleted
'
,
models
.
BooleanField
(
default
=
False
,
verbose_name
=
'
is deleted
'
)),
(
'
user
'
,
models
.
OneToOneField
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
settings
.
AUTH_USER_MODEL
)),
],
options
=
{
...
...
This diff is collapsed.
Click to expand it.
adherents/models.py
+
5
−
13
View file @
e66d4612
...
...
@@ -35,7 +35,7 @@ class Profile(models.Model):
phone_number
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
,
null
=
Fals
e
,
null
=
Tru
e
,
default
=
''
,
verbose_name
=
_
(
'
phone number
'
),
)
...
...
@@ -46,15 +46,13 @@ class Profile(models.Model):
)
genre
=
models
.
CharField
(
max_length
=
1
,
blank
=
Fals
e
,
null
=
Fals
e
,
blank
=
Tru
e
,
null
=
Tru
e
,
choices
=
GENRES
,
default
=
None
,
)
address
=
models
.
TextField
(
blank
=
True
,
null
=
False
,
default
=
''
,
null
=
True
,
)
paid
=
models
.
BooleanField
(
verbose_name
=
_
(
"
paid
"
),
...
...
@@ -73,9 +71,6 @@ class Profile(models.Model):
verbose_name
=
_
(
'
user profile
'
)
verbose_name_plural
=
_
(
'
user profile
'
)
def
__str__
(
self
):
return
self
.
user
.
get_username
()
class
MembershipFee
(
models
.
Model
):
"""
...
...
@@ -99,12 +94,9 @@ class MembershipFee(models.Model):
verbose_name
=
_
(
'
membership fee
'
)
verbose_name_plural
=
_
(
'
membership fees
'
)
def
__str__
(
self
):
return
self
.
user
.
get_username
()
@receiver
(
post_save
,
sender
=
User
)
def
save_user_profile
(
sender
,
instance
,
created
,
**
_kwargs
):
def
save_user_profile
(
instance
,
created
,
**
_kwargs
):
"""
Hook to save an user profile when an user is updated
"""
...
...
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