Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
dima
/
sms-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6d67ec79
authored
May 04, 2018
by
dima
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update goip/tasks.py
parent
5312aa61
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
3 deletions
goip/tasks.py
goip/tasks.py
View file @
6d67ec79
...
@@ -2,7 +2,6 @@ from goip.helpers import get_goips, reset_sms_count, generate_sms
...
@@ -2,7 +2,6 @@ from goip.helpers import get_goips, reset_sms_count, generate_sms
from
.models
import
SmsGroup
,
SmsHistory
,
GoipNames
from
.models
import
SmsGroup
,
SmsHistory
,
GoipNames
from
sms_service.celery
import
app
from
sms_service.celery
import
app
from
.helpers
import
GOIP
from
.helpers
import
GOIP
import
uuid
DELAY
=
60
DELAY
=
60
...
@@ -16,8 +15,7 @@ class UpdateSMStatusError(Exception):
...
@@ -16,8 +15,7 @@ class UpdateSMStatusError(Exception):
def
list_send_sms
(
group_id
,
numbers
,
text
):
def
list_send_sms
(
group_id
,
numbers
,
text
):
group
=
SmsGroup
.
objects
.
get
(
uuid
=
group_id
)
group
=
SmsGroup
.
objects
.
get
(
uuid
=
group_id
)
for
number
,
sms_text
in
generate_sms
(
numbers
,
text
):
for
number
,
sms_text
in
generate_sms
(
numbers
,
text
):
sms_id
=
str
(
uuid
.
uuid4
())
sms_id
=
GOIP
.
send_sms
(
sms_text
,
number
)
# sms_id = GOIP.send_sms(sms_text, number)
group
.
sms
.
create
(
sms_id
=
sms_id
,
number
=
number
,
text
=
sms_text
)
group
.
sms
.
create
(
sms_id
=
sms_id
,
number
=
number
,
text
=
sms_text
)
update_sms_status
.
apply_async
((
sms_id
,),
countdown
=
DELAY
)
update_sms_status
.
apply_async
((
sms_id
,),
countdown
=
DELAY
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment