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
6e69e789
Commit
6e69e789
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
unnecessary code removed
parent
60e7fdd6
No related branches found
No related tags found
1 merge request
!35
performance on appointment list
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
smash/web/views/appointment.py
+0
-2
0 additions, 2 deletions
smash/web/views/appointment.py
smash/web/views/notifications.py
+1
-9
1 addition, 9 deletions
smash/web/views/notifications.py
with
1 addition
and
11 deletions
smash/web/views/appointment.py
+
0
−
2
View file @
6e69e789
# coding=utf-8
from
django.shortcuts
import
get_object_or_404
,
redirect
from
notifications
import
get_today_midnight_date
,
get_filter_locations
,
get_calendar_full_appointments
,
\
get_unfinished_appointments
from
.
import
wrap_response
from
..forms
import
AppointmentDetailForm
,
AppointmentAddForm
,
AppointmentEditForm
,
SubjectEditForm
from
..models
import
Appointment
...
...
This diff is collapsed.
Click to expand it.
smash/web/views/notifications.py
+
1
−
9
View file @
6e69e789
...
...
@@ -241,12 +241,4 @@ def get_filter_locations(user):
def
get_today_midnight_date
():
today
=
datetime
.
datetime
.
now
()
today_midnight
=
datetime
.
datetime
(
today
.
year
,
today
.
month
,
today
.
day
)
return
today_midnight
def
get_calendar_full_appointments
(
user
):
month_ago
=
get_today_midnight_date
()
+
datetime
.
timedelta
(
days
=-
31
)
return
Appointment
.
objects
.
filter
(
datetime_when__gt
=
month_ago
,
location__in
=
get_filter_locations
(
user
),
).
order_by
(
'
datetime_when
'
)
return
today_midnight
\ No newline at end of file
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