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
2c2179b5
Commit
2c2179b5
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
redundant logging removed
parent
8d229eaa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!100
Test coverage unit tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
smash/web/api_views/subject.py
+5
-9
5 additions, 9 deletions
smash/web/api_views/subject.py
with
5 additions
and
9 deletions
smash/web/api_views/subject.py
+
5
−
9
View file @
2c2179b5
...
...
@@ -5,7 +5,7 @@ from django.db.models import Count, Case, When, Min
from
django.db.models
import
Q
from
django.http
import
JsonResponse
from
web.models
import
Subject
,
StudySubject
,
Visit
,
Appointment
from
web.models
import
StudySubject
,
Visit
,
Appointment
,
Subject
from
web.models.constants
import
SUBJECT_TYPE_CHOICES
from
web.views
import
e500_error
from
web.views.notifications
import
get_subjects_with_no_visit
,
get_subjects_with_reminder
,
get_today_midnight_date
...
...
@@ -16,14 +16,10 @@ logger = logging.getLogger(__name__)
@login_required
def
cities
(
request
):
try
:
result_subjects
=
Subject
.
objects
.
filter
(
city__isnull
=
False
).
values_list
(
'
city
'
).
distinct
()
return
JsonResponse
({
"
cities
"
:
[
x
[
0
]
for
x
in
result_subjects
]
})
except
Exception
as
e
:
logger
.
error
(
e
,
exc_info
=
True
)
return
e500_error
(
request
)
result_subjects
=
Subject
.
objects
.
filter
(
city__isnull
=
False
).
values_list
(
'
city
'
).
distinct
()
return
JsonResponse
({
"
cities
"
:
[
x
[
0
]
for
x
in
result_subjects
]
})
@login_required
...
...
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