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
1d579cc1
Commit
1d579cc1
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
workers in daily planning limited to staff
parent
a6fb4bb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!117
Resolve "extend worker class"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/api_views/daily_planning.py
+4
-7
4 additions, 7 deletions
smash/web/api_views/daily_planning.py
with
4 additions
and
7 deletions
smash/web/api_views/daily_planning.py
+
4
−
7
View file @
1d579cc1
...
...
@@ -4,13 +4,11 @@ import logging
from
operator
import
itemgetter
from
django.contrib.auth.decorators
import
login_required
from
django.db.models
import
Q
from
django.http
import
JsonResponse
from
django.shortcuts
import
get_object_or_404
from
web.models.constants
import
GLOBAL_STUDY_ID
from
web.models.worker_study_role
import
ROLE_CHOICES_DOCTOR
,
ROLE_CHOICES_NURSE
,
ROLE_CHOICES_PSYCHOLOGIST
from
web.models
import
Appointment
,
AppointmentTypeLink
,
Worker
,
Availability
,
Holiday
from
web.models.worker_study_role
import
WORKER_STAFF
from
web.views
import
e500_error
from
web.views.notifications
import
get_filter_locations
...
...
@@ -303,10 +301,9 @@ def events(request, date):
def
get_workers_for_daily_planning
(
request
):
result
=
Worker
.
objects
.
filter
(
locations__in
=
get_filter_locations
(
request
.
user
)).
filter
(
user__is_active
=
True
).
filter
(
Q
(
roles__study_id
=
GLOBAL_STUDY_ID
)
&
Q
(
roles__role__in
=
[
ROLE_CHOICES_DOCTOR
,
ROLE_CHOICES_NURSE
,
ROLE_CHOICES_PSYCHOLOGIST
])).
distinct
()
result
=
Worker
.
get_workers_by_worker_type
(
WORKER_STAFF
).
filter
(
locations__in
=
get_filter_locations
(
request
.
user
)).
filter
(
user__is_active
=
True
).
distinct
()
return
result
...
...
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