Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
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
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
AURA
steering
Commits
b96eecc7
Commit
b96eecc7
authored
8 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
be explicit about what is not allowed to change while updating.
parent
18d04533
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
program/models.py
+14
-8
14 additions, 8 deletions
program/models.py
with
14 additions
and
8 deletions
program/models.py
+
14
−
8
View file @
b96eecc7
...
...
@@ -336,14 +336,20 @@ class ProgramSlot(models.Model):
def
save
(
self
,
*
args
,
**
kwargs
):
if
self
.
pk
:
old
=
ProgramSlot
.
objects
.
get
(
pk
=
self
.
pk
)
if
self
.
rrule
!=
old
.
rrule
\
or
self
.
byweekday
!=
old
.
byweekday
\
or
self
.
show
!=
old
.
show
\
or
self
.
dstart
!=
old
.
dstart
\
or
self
.
tstart
!=
old
.
tstart
\
or
self
.
tend
!=
old
.
tend
\
or
self
.
is_repetition
!=
old
.
is_repetition
:
raise
ValidationError
(
u
"
only until can be changed
"
)
if
self
.
rrule
!=
old
.
rrule
:
raise
ValidationError
(
u
"
Recurrence rule cannot ba changed
"
)
if
self
.
byweekday
!=
old
.
byweekday
:
raise
ValidationError
(
u
"
Weekday cannot be changed
"
)
if
self
.
show
!=
old
.
show
:
raise
ValidationError
(
u
"
Show cannot be changed
"
)
if
self
.
dstart
!=
old
.
dstart
:
raise
ValidationError
(
u
"
First date cannot ba changed
"
)
if
self
.
tstart
!=
old
.
tstart
:
raise
ValidationError
(
u
"
Start time cannot be changed
"
)
if
self
.
tend
!=
old
.
tend
:
raise
ValidationError
(
u
"
End time cannot be changed
"
)
if
self
.
is_repetition
!=
old
.
is_repetition
:
raise
ValidationError
(
u
"
Is repetition cannot be changed
"
)
else
:
old
=
False
...
...
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