Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scheduling-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
SMASCH
scheduling-system
Commits
695d1141
Commit
695d1141
authored
3 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
length must be positive
parent
f9c270b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!396
Resolve "Appointment with 0 length can be added (question)"
Pipeline
#48694
passed
3 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG
+2
-0
2 additions, 0 deletions
CHANGELOG
smash/web/forms/appointment_form.py
+1
-3
1 addition, 3 deletions
smash/web/forms/appointment_form.py
with
3 additions
and
3 deletions
CHANGELOG
+
2
−
0
View file @
695d1141
...
...
@@ -60,6 +60,8 @@ smasch (1.1.0~alpha.0-1) unstable; urgency=low
(#458)
* bug fix: validation for some configuration items did not exist (#456)
* bug fix: prevent fetching favicon - we don't have it (#304)
* bug fix: when adding/editing appointment length must be a positive value
(#464, 462)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 25 Feb 2021 17:00:00 +0200
...
...
This diff is collapsed.
Click to expand it.
smash/web/forms/appointment_form.py
+
1
−
3
View file @
695d1141
...
...
@@ -25,8 +25,7 @@ class AppointmentForm(ModelForm):
datetime_when
=
forms
.
DateTimeField
(
label
=
'
Appointment on
'
,
widget
=
forms
.
DateTimeInput
(
DATETIMEPICKER_DATE_ATTRS
)
)
length
=
forms
.
IntegerField
(
label
=
'
Appointment length (in minutes)
'
,
min_value
=
0
)
length
=
forms
.
IntegerField
(
label
=
'
Appointment length (in minutes)
'
,
min_value
=
1
)
user
:
Worker
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -187,7 +186,6 @@ class AppointmentAddForm(AppointmentForm):
fields
[
'
worker_assigned
'
].
widget
.
attrs
=
{
'
class
'
:
'
search_worker_availability
'
}
fields
[
'
datetime_when
'
].
widget
.
attrs
=
{
'
class
'
:
'
start_date
'
,
'
placeholder
'
:
'
yyyy-mm-dd HH:MM
'
,
'
pattern
'
:
'
[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}
'
}
fields
[
'
length
'
].
widget
.
attrs
=
{
'
class
'
:
'
appointment_duration
'
}
self
.
fields
=
fields
self
.
fields
[
'
location
'
].
queryset
=
self
.
user
.
locations
...
...
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