diasporadiaries

a platform for writing stories with personal accounts and messages
git clone git://parazyd.org/diasporadiaries.git
Log | Files | Refs | Submodules | README | LICENSE

commit 553e84903df7926c86f16a033ed9a10c26b72645
parent abe01fdd3fab0d292ccd02c6f07b00fb10e6bec3
Author: parazyd <parazyd@dyne.org>
Date:   Wed, 23 Jan 2019 16:06:15 +0100

Solve initial message issue.

The first user will be created for admin tasks anyway.

Diffstat:
Mutils.py | 11++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/utils.py b/utils.py @@ -255,11 +255,12 @@ def make_profile(name, email): msgpath = join('messages', email) makedirs(msgpath, exist_ok=True) - # XXX: Unseen in UI because it's not a real user. - welcome_msg = "Welcome to Diaspora Diaries! Enjoy your stay :)" - with open(join(msgpath, 'admin@diasporadiaries.eu'), 'w') as msgfile: - json.dump([{'from': 'Diaspora Diaries', 'message': welcome_msg, - 'time': int(time())}], msgfile) + initial_user = find_user_by_id(1) + if initial_user: + welcome_msg = "Welcome to Diaspora Diaries! Enjoy your stay :)" + with open(join(msgpath, initial_user['email']), 'w') as msgfile: + json.dump([{'from': 'Diaspora Diaries', 'message': welcome_msg, + 'time': int(time())}], msgfile) return plain_pw