Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Alsijil
Commits
feea1e23
Verified
Commit
feea1e23
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix unique constraint on personal notes
(cherry picked from commit
d193a0e8
)
parent
77521294
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!228
Prepare release 2.0rc6
Pipeline
#29675
passed
3 years ago
Stage: test
Stage: build
Stage: publish
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.rst
+1
-1
1 addition, 1 deletion
CHANGELOG.rst
aleksis/apps/alsijil/migrations/0015_fix_unique_personal_note.py
+29
-0
29 additions, 0 deletions
.../apps/alsijil/migrations/0015_fix_unique_personal_note.py
aleksis/apps/alsijil/models.py
+10
-8
10 additions, 8 deletions
aleksis/apps/alsijil/models.py
with
40 additions
and
9 deletions
CHANGELOG.rst
+
1
−
1
View file @
feea1e23
...
...
@@ -18,6 +18,7 @@ Fixed
~~~~~
* Fix problems with displaying dates for events in the week and lesson view.
* Unique constraint on lesson documentations and personal notes did not work and caused racey duplicates.
`2.0rc5`_ - 2021-08-12
----------------------
...
...
@@ -27,7 +28,6 @@ Fixed
* The _Delete personal note_ action didn't work due to wrong usage of ``bulk_update``.
* Groups and persons were shown multiple times in some forms due to filtering by permissions.
* Unique constraint on lesson documentations did not work and caused racey duplicates.
`2.0rc4`_ - 2021-08-01
----------------------
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/migrations/0015_fix_unique_personal_note.py
0 → 100644
+
29
−
0
View file @
feea1e23
# Generated by Django 3.2.4 on 2021-08-29 13:31
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
alsijil
'
,
'
0014_fix_unique_lesson_documentation
'
),
]
operations
=
[
migrations
.
RemoveConstraint
(
model_name
=
'
personalnote
'
,
name
=
'
unique_personal_note_per_object
'
,
),
migrations
.
AddConstraint
(
model_name
=
'
personalnote
'
,
constraint
=
models
.
UniqueConstraint
(
fields
=
(
'
week
'
,
'
year
'
,
'
lesson_period
'
,
'
person
'
),
name
=
'
unique_note_per_lp
'
),
),
migrations
.
AddConstraint
(
model_name
=
'
personalnote
'
,
constraint
=
models
.
UniqueConstraint
(
fields
=
(
'
week
'
,
'
year
'
,
'
event
'
,
'
person
'
),
name
=
'
unique_note_per_ev
'
),
),
migrations
.
AddConstraint
(
model_name
=
'
personalnote
'
,
constraint
=
models
.
UniqueConstraint
(
fields
=
(
'
week
'
,
'
year
'
,
'
extra_lesson
'
,
'
person
'
),
name
=
'
unique_note_per_el
'
),
),
]
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/models.py
+
10
−
8
View file @
feea1e23
...
...
@@ -283,8 +283,13 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel):
check
=
lesson_related_constraint_q
,
name
=
"
one_relation_only_personal_note
"
),
models
.
UniqueConstraint
(
fields
=
(
"
lesson_period
"
,
"
week
"
,
"
year
"
,
"
event
"
,
"
extra_lesson
"
),
name
=
"
unique_personal_note_per_object
"
,
fields
=
(
"
week
"
,
"
year
"
,
"
lesson_period
"
,
"
person
"
),
name
=
"
unique_note_per_lp
"
,
),
models
.
UniqueConstraint
(
fields
=
(
"
week
"
,
"
year
"
,
"
event
"
,
"
person
"
),
name
=
"
unique_note_per_ev
"
,
),
models
.
UniqueConstraint
(
fields
=
(
"
week
"
,
"
year
"
,
"
extra_lesson
"
,
"
person
"
),
name
=
"
unique_note_per_el
"
,
),
]
...
...
@@ -373,16 +378,13 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
check
=
lesson_related_constraint_q
,
name
=
"
one_relation_only_lesson_documentation
"
,
),
models
.
UniqueConstraint
(
fields
=
(
"
week
"
,
"
year
"
,
"
lesson_period
"
),
name
=
"
unique_documentation_per_lp
"
,
fields
=
(
"
week
"
,
"
year
"
,
"
lesson_period
"
),
name
=
"
unique_documentation_per_lp
"
,
),
models
.
UniqueConstraint
(
fields
=
(
"
week
"
,
"
year
"
,
"
event
"
),
name
=
"
unique_documentation_per_ev
"
,
fields
=
(
"
week
"
,
"
year
"
,
"
event
"
),
name
=
"
unique_documentation_per_ev
"
,
),
models
.
UniqueConstraint
(
fields
=
(
"
week
"
,
"
year
"
,
"
extra_lesson
"
),
name
=
"
unique_documentation_per_el
"
,
fields
=
(
"
week
"
,
"
year
"
,
"
extra_lesson
"
),
name
=
"
unique_documentation_per_el
"
,
),
]
...
...
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