SciPost Code Repository
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SciPost
Manage
Activity
Members
Labels
Plan
Issues
118
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
SciPost
SciPost
Commits
2676662c
Commit
2676662c
authored
5 years ago
by
Jean-Sébastien Caux
Browse files
Options
Downloads
Patches
Plain Diff
Refactor urlpatterns
parent
2202e782
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apimail/api/views.py
+1
-1
1 addition, 1 deletion
apimail/api/views.py
apimail/urls.py
+24
-21
24 additions, 21 deletions
apimail/urls.py
with
25 additions
and
22 deletions
apimail/api/views.py
+
1
−
1
View file @
2676662c
...
...
@@ -45,7 +45,6 @@ class StoredMessageFilterBackend(filters.BaseFilterBackend):
elif
period
==
'
week
'
:
days
=
1
limit
=
timezone
.
now
()
-
datetime
.
timedelta
(
days
=
days
)
print
(
limit
)
queryset
=
queryset
.
filter
(
datetimestamp__gt
=
limit
)
_from
=
request
.
query_params
.
get
(
'
from
'
,
None
)
...
...
@@ -57,6 +56,7 @@ class StoredMessageFilterBackend(filters.BaseFilterBackend):
recipients
=
request
.
query_params
.
get
(
'
recipients
'
,
None
)
if
recipients
is
not
None
:
queryfilter
=
queryfilter
|
Q
(
data__recipients__icontains
=
recipients
)
# For full-text searches through body-plain / body-html, we use a
# raw SQL query since Django ORM does not support hyphenated lookups,
# and since Mailgun uses hyphenated keys in its JSON responses.
...
...
This diff is collapsed.
Click to expand it.
apimail/urls.py
+
24
−
21
View file @
2676662c
...
...
@@ -2,7 +2,7 @@ __copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__
=
"
AGPL v3
"
from
django.urls
import
path
from
django.urls
import
include
,
path
from
apimail.api
import
views
as
apiviews
from
.
import
views
...
...
@@ -14,26 +14,29 @@ urlpatterns = [
# API
path
(
# /mail/api/events
'
api/events
'
,
apiviews
.
EventListAPIView
.
as_view
(),
name
=
'
api_event_list
'
),
path
(
# /mail/api/event/<uuid>
'
api/event/<uuid:uuid>
'
,
apiviews
.
EventRetrieveAPIView
.
as_view
(),
name
=
'
api_event_retrieve
'
),
path
(
# /mail/api/stored_messages
'
api/stored_messages
'
,
apiviews
.
StoredMessageListAPIView
.
as_view
(),
name
=
'
api_stored_message_list
'
),
path
(
# /mail/api/stored_message/<uuid>
'
api/stored_message/<uuid:uuid>
'
,
apiviews
.
StoredMessageRetrieveAPIView
.
as_view
(),
name
=
'
api_stored_message_retrieve
'
),
path
(
'
api/
'
,
include
([
path
(
# /mail/api/events
'
events
'
,
apiviews
.
EventListAPIView
.
as_view
(),
name
=
'
api_event_list
'
),
path
(
# /mail/api/event/<uuid>
'
event/<uuid:uuid>
'
,
apiviews
.
EventRetrieveAPIView
.
as_view
(),
name
=
'
api_event_retrieve
'
),
path
(
# /mail/api/stored_messages
'
stored_messages
'
,
apiviews
.
StoredMessageListAPIView
.
as_view
(),
name
=
'
api_stored_message_list
'
),
path
(
# /mail/api/stored_message/<uuid>
'
stored_message/<uuid:uuid>
'
,
apiviews
.
StoredMessageRetrieveAPIView
.
as_view
(),
name
=
'
api_stored_message_retrieve
'
),
])),
# User views
...
...
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