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
44e717f3
Commit
44e717f3
authored
Oct 30, 2013
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move the registration to mailman in a management command
parent
8318db23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
1 deletion
+16
-1
newsletter/management/__init__.py
newsletter/management/__init__.py
+0
-0
newsletter/management/commands/__init__.py
newsletter/management/commands/__init__.py
+0
-0
newsletter/management/commands/update_newsletter_subscribers.py
...tter/management/commands/update_newsletter_subscribers.py
+16
-0
newsletter/views.py
newsletter/views.py
+0
-1
No files found.
newsletter/management/__init__.py
0 → 100644
View file @
44e717f3
newsletter/management/commands/__init__.py
0 → 100644
View file @
44e717f3
newsletter/management/commands/update_newsletter_subscribers.py
0 → 100644
View file @
44e717f3
from
optparse
import
make_option
from
django.core.management.base
import
BaseCommand
,
CommandError
from
...models
import
Subscriber
class
Command
(
BaseCommand
):
def
handle
(
self
,
verbosity
,
**
kwargs
):
self
.
verbose
=
(
verbosity
>
1
)
for
subscriber
in
Subscriber
.
objects
.
filter
(
is_validated
=
True
).
exclude
(
is_registered
=
True
):
if
self
.
verbose
:
print
'subscribing'
,
subscriber
.
email
subscriber
.
subscribe_in_mailman
()
newsletter/views.py
View file @
44e717f3
...
...
@@ -47,7 +47,6 @@ class ConfirmationView(TemplateView):
subscriber
=
get_object_or_404
(
Subscriber
,
password
=
token
,
is_validated
=
False
)
subscriber
.
is_validated
=
True
subscriber
.
save
()
subscriber
.
subscribe_in_mailman
()
return
context
confirmation
=
ConfirmationView
.
as_view
()
...
...
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