Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dbchiro
dbchiroweb
Commits
5913a469
Commit
5913a469
authored
Apr 11, 2021
by
hypsug0
Browse files
fix: set main_observer to null on user delete
parent
054067b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
sights/models.py
View file @
5913a469
...
...
@@ -12,7 +12,7 @@ from django.core.files.storage import FileSystemStorage
from
django.core.validators
import
MaxValueValidator
,
MinValueValidator
from
django.db
import
models
from
django.db.models
import
Sum
from
django.db.models.deletion
import
DO_NOTHING
from
django.db.models.deletion
import
DO_NOTHING
,
SET_NULL
from
django.db.models.signals
import
post_delete
,
post_save
from
django.dispatch
import
receiver
from
django.urls
import
reverse
...
...
@@ -860,7 +860,7 @@ class Session(models.Model):
),
)
main_observer
=
models
.
ForeignKey
(
settings
.
AUTH_USER_MODEL
,
on_delete
=
DO_NOTHING
,
related_name
=
"mainobs"
settings
.
AUTH_USER_MODEL
,
on_delete
=
SET_NULL
,
related_name
=
"mainobs"
,
null
=
True
)
other_observer
=
models
.
ManyToManyField
(
settings
.
AUTH_USER_MODEL
,
blank
=
True
,
related_name
=
"otherobs"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment