First time here? Check out the FAQ!
0

How can I change the email alert frequency settings for every user?
 

Since I haven't launched my Askbot site yet, but I have thousands of users in my database, I want to change all their email alert frequency settings to the default values.

How can I do that with Django ORM or MySql?

Thanks!

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
siovene's avatar
431
siovene
asked 12 years ago

Comments

I can see that it's in askbot_emailfeedsetting, but it looks complicated.

siovene's avatar siovene (12 years ago)
see more comments

1 Answer

2

I've got it!

**mysql> update askbot_emailfeedsetting set frequency='i' where feed_type='m_and_c';
Query OK, 2711 rows affected (0.09 sec)
Rows matched: 2713  Changed: 2711  Warnings: 0

mysql> update askbot_emailfeedsetting set frequency='i' where feed_type='q_ask';
Query OK, 2709 rows affected (0.09 sec)
Rows matched: 2712  Changed: 2709  Warnings: 0

mysql> update askbot_emailfeedsetting set frequency='n' where feed_type='q_all';
Query OK, 2711 rows affected (0.08 sec)
Rows matched: 2712  Changed: 2711  Warnings: 0

mysql> update askbot_emailfeedsetting set frequency='i' where feed_type='q_sel';
Query OK, 2711 rows affected (0.04 sec)
Rows matched: 2712  Changed: 2711  Warnings: 0

mysql> update askbot_emailfeedsetting set frequency='d' where feed_type='q_ans';
Query OK, 2 rows affected (0.08 sec)
Rows matched: 2712  Changed: 2  Warnings: 0

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
siovene's avatar
431
siovene
answered 12 years ago
link

Comments

1

They should be added automatically actually. There is a function user.add_missing_askbot_subscriptions() which will set the default values.

Evgeny's avatar Evgeny (12 years ago)
1

Yeah, but mine weren't missing. I just didn't set them to my liking, and wanted to change them.

siovene's avatar siovene (12 years ago)
see more comments