atomic user creation/notification
parent
4e3977edd2
commit
5220d9bfad
|
@ -246,9 +246,13 @@ def on_townie_pre_save(sender, instance, **kwargs):
|
|||
# See if we need to create the user on disk.
|
||||
if existing.unreviewed and instance.accepted:
|
||||
logger.info('Creating user {} on disk.'.format(instance.username))
|
||||
try:
|
||||
instance.create_on_disk()
|
||||
instance.send_welcome_email()
|
||||
instance.write_authorized_keys()
|
||||
except Exception as e:
|
||||
logger.error('Failed syncing user {} to disk: {}'.format(instance.username, e)
|
||||
else:
|
||||
instance.send_welcome_email()
|
||||
return
|
||||
else:
|
||||
# This user state transition is currently undefined. In the future, we can check for things
|
||||
|
|
Loading…
Reference in New Issue