discourse/script
Blake Erickson ed0e4582a1
DEV: If disabled do not change setting after import (#12142)
When running an import script there are many site settings that are
changed but we reset them back to where they were originally before the
import. However, there are two settings that we don't roll back:

```
purge_unactivated_users_grace_period_days
purge_deleted_uploads_grace_period_days
```

which could have some unintended consequences.

My first question is do we *really* have to change these settings? I'm
not a huge fan of changing someones settings without them really knowing
they were changed.

If we really do have to change these settings here is my proposed PR
where we don't alter the `purge_unactivated_users_grace_period_days` if
it has been disabled.

As I'm writing this another change we could make is that we don't change
either of these site settings if we detect that they aren't set to the
default values.

The drive behind this PR is that there is a discourse instance which
relies on staged users as part of their workflow and this setting was
changed by accident via the import script causing users to be deleted
that shouldn't have been.
2021-02-19 09:33:35 -07:00
..
benchmarks FEATURE: Rename 'Discourse SSO' to DiscourseConnect (#11978) 2021-02-08 10:04:33 +00:00
bulk_import fix vbulletin importer to hide soft-deleted posts (#12057) 2021-02-12 14:29:05 +01:00
demon_test FIX: Revert Demon::DemonBase back to Demon::Base (#8132) 2019-10-02 14:54:08 +10:00
import_scripts DEV: If disabled do not change setting after import (#12142) 2021-02-19 09:33:35 -07:00
.gitignore improvements to the mbox import script 2017-11-18 17:16:44 +01:00
alice.txt more progress towards live unread and new counts, unread message implemented, still to implement delete messages 2013-05-30 16:49:57 +10:00
analyze_sidekiq_queues.rb correct type 2019-05-22 12:28:17 +10:00
bench.rb DEV: Update facter usage 2020-06-01 05:50:49 +02:00
biggest_objects.rb DEV: add debugging scripts for memory leaks 2019-10-03 16:36:31 +10:00
boot_mem.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
cache_critical_dns DEV: Support env var for prometheus port in cache_critical_dns 2020-08-17 15:48:14 -04:00
check_forking.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
compile_hbs.rb Rename the server side widget hbs compiler 2020-03-27 12:06:14 -04:00
copyright-deposit Add script for compiling copyright deposits (#9646) 2020-05-06 12:51:45 -04:00
diff_heaps.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
discourse FEATURE: Allow overriding the backup location when restoring via CLI (#12015) 2021-02-09 16:02:44 +01:00
docker_test.rb Revert "DEV: Remove the remaining ENV["TRAVIS"] usage (#10041)" 2020-06-16 19:42:00 +02:00
downsize_uploads.rb FIX: Improvements and fixes to the image downsizing script (#9950) 2020-06-11 14:47:59 +02:00
i18n_lint.rb DEV: Lint MessageFormat strings to prevent usage of "one {foo 1 bar}" (#11608) 2021-01-04 12:29:20 +01:00
json_to_rswag.rb DEV: api documentation updates (#9612) 2020-05-11 13:06:49 -06:00
measure.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
memory-analysis DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
memstats.rb DEV: Apply Rubocop redundant return style 2019-11-14 15:10:51 -05:00
micro_bench.rb DEV: undo pluck_first changes to micro benchmark 2019-10-21 12:21:24 +01:00
mwrap_sidekiq PERF: avoid shelling to get hostname aggressively 2020-02-18 15:13:19 +11:00
profile_db_generator.rb FIX: ensure we consistently pick the same topic for bench 2020-01-08 16:33:45 +11:00
rails DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
redis_memory.rb DEV: s/\$redis/Discourse\.redis (#8431) 2019-12-03 10:05:53 +01:00
require_profiler.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
spawn_backup_restore.rb FIX: Killing a Unicorn worker shouldn't kill a running backup or restore process 2020-10-13 19:48:53 +02:00
switch_container_ruby DEV: add script to switch ruby version from inside container 2019-03-25 17:41:24 +11:00
test_email_settings.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
test_hbs_compiler.rb REFACTOR: Remove `Discourse.__widget_helpers` 2020-08-06 14:35:46 -04:00
test_mem.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
test_memory_leak.rb DEV: improve diagnostics on mem leak checker 2019-10-04 09:47:33 +10:00
test_pretty_text.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
thread_detective.rb PERF: avoid spinning a thread each time we close a connection 2019-09-12 17:34:04 +10:00
user_simulator.rb DEV: User simulator tried to modify frozen string. 2019-08-16 17:32:17 +03:00
version_bump.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00