Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-newsletter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-newsletter
Commits
01477e83
Commit
01477e83
authored
Sep 14, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use listadmin to do the mailman plumbing
parent
72ffb1d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
newsletter/models.py
newsletter/models.py
+6
-12
No files found.
newsletter/models.py
View file @
01477e83
...
...
@@ -2,7 +2,7 @@
import
hashlib
import
random
import
urllib
import
subprocess
from
django.db
import
models
...
...
@@ -39,14 +39,8 @@ class Subscriber(models.Model) :
self
.
save
()
def
subscribe_in_mailman
(
self
):
params
=
urllib
.
urlencode
(
{
'email'
:
self
.
email
,
'fullname'
:
''
,
'pw'
:
self
.
password
,
'pw-conf'
:
self
.
password
,
'digest'
:
'0'
})
response
=
urllib
.
urlopen
(
settings
.
NEWSLETTER_SUBSCRIBE_URL
,
params
)
response
.
read
()
response
.
close
()
# TODO: error handling
# TODO: connecting to the moderation URL to validate
#self.registered = True
#self.save()
t
=
subprocess
.
call
([
'listadmin'
,
'--add-member'
,
self
.
email
,
settings
.
NEWSLETTER_NAME
])
if
t
!=
0
:
return
self
.
registered
=
True
self
.
save
()
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