First time here? Check out the FAQ!

Revision history  [back]

(prev answer overwritten)

edit: added a management command to fix this (starting version 0.6.28 and available in github master branch)

python manage.py add_missing_subscriptions

(prev answer overwritten)

edit: added Try adding this after your user creation code:

from askbot import forms
user = ... #create the user
form = forms.SimpleEmailSubscribeForm({'subscribe':'y'})#defaults
form.save(user = user)

This should work, or something along the lines. save() method on that form create email subscription data for that person. Also you can directly create subscriptions.

from askbot import models
models.EmailFeedSetting.objects.get_or_create(
                                        subscriber=user,
                                        feed_type=feed_type,
                                        frequency=frequency,
                                    )
#where values of feed_type is one of EmailFeedSetting.FEED_TYPES
#and frequency - one of available keys in EmailFeedSetting.DELTA_TABLE
#can be found in file askbot/models/user.py

Every person must have a management command setting for each of the feed types, otherwise you'll see that error.

Maybe it's best to fix create a method to make a user account programmatically if you have energy for that, I'll add it to the trunk code.

The user accounts are created in askbot.deps.django_authopenid.views.register function but there are other things as well - such as creating an association between the user and the login method. Eventually this (starting version 0.6.28 and available dependency app will be a separate thing that can be used on its own, but for now it's in github master branch)

python manage.py add_missing_subscriptions
the askbot/deps directory b/c it's forked from django_authopenid.

Try adding this after your user creation code:

from askbot import forms
 user = ... #create the user
form = forms.SimpleEmailSubscribeForm({'subscribe':'y'})#defaults
form.save(user = user)

This should work, or something along the lines. save() method on that form create email subscription data for that person. Also you can directly create subscriptions.

from askbot import models
models.EmailFeedSetting.objects.get_or_create(
                                        subscriber=user,
                                        feed_type=feed_type,
                                        frequency=frequency,
                                    )
#where values of feed_type is one of EmailFeedSetting.FEED_TYPES
#and frequency - one of available keys in EmailFeedSetting.DELTA_TABLE
#can be found in file askbot/models/user.py

Every person must have a setting for each of the feed types, otherwise you'll see that error.

Maybe it's best to create a method to make a user account programmatically if you have energy for that, I'll add it to the trunk code.

The user accounts are created in askbot.deps.django_authopenid.views.register function but there are other things as well - such as creating an association between the user and the login method. Eventually this dependency app will be a separate thing that can be used on its own, but for now it's in the askbot/deps directory b/c it's forked from django_authopenid.

Try adding this after your user creation code:

from askbot import forms

user = ... #create the user
form = forms.SimpleEmailSubscribeForm({'subscribe':'y'})#defaults
forms.SimpleEmailSubscribeForm({'subscribe':'y'})#default subscriptions
form.save(user = user)

This should work, or something along the lines. save() method on that form create email subscription data for that person. Also you can directly create subscriptions.

from askbot import models
models.EmailFeedSetting.objects.get_or_create(
                                        subscriber=user,
                                        feed_type=feed_type,
                                        frequency=frequency,
                                    )
#where values of feed_type is one of EmailFeedSetting.FEED_TYPES
#and frequency - one of available keys in EmailFeedSetting.DELTA_TABLE
#can be found in file askbot/models/user.py

Every person must have a setting for each of the feed types, otherwise you'll see that error.

Maybe it's best to create a method to make a user account programmatically if you have energy for that, I'll add it to the trunk code.

The user accounts are created in askbot.deps.django_authopenid.views.register function but there are other things as well - such as creating an association between the user and the login method. Eventually this dependency app will be a separate thing that can be used on its own, but for now it's in the askbot/deps directory b/c it's forked from django_authopenid.

Try adding this after your user creation code:

from askbot import forms

user = ... #create the user
form = forms.SimpleEmailSubscribeForm({'subscribe':'y'})#default subscriptions
forms.SimpleEmailSubscribeForm({'subscribe':'y'})
form.save(user = user)

This should work, or something along the lines. save() method on that form create email subscription data for that person. Also you can directly create subscriptions.

from askbot import models
models.EmailFeedSetting.objects.get_or_create(
                                        subscriber=user,
                                        feed_type=feed_type,
                                        frequency=frequency,
                                    )
#where values of feed_type is one of EmailFeedSetting.FEED_TYPES
#and frequency - one of available keys in EmailFeedSetting.DELTA_TABLE
#can be found in file askbot/models/user.py

Every person must have a setting for each of the feed types, otherwise you'll see that error.

Maybe it's best to create a method to make a user account programmatically if you have energy for that, I'll add it to the trunk code.

The user accounts are created in askbot.deps.django_authopenid.views.register function but there are other things as well - such as creating an association between the user and the login method. Eventually this dependency app will be a separate thing that can be used on its own, but for now it's in the askbot/deps directory b/c it's forked from django_authopenid.