-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update models for generic prepub notifications #4089
- Loading branch information
Showing
4 changed files
with
56 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Generated by Django 3.2.20 on 2024-04-17 15:26 | ||
|
||
from django.db import migrations | ||
from utils import migration_utils | ||
|
||
|
||
def replace_peer_reviewer_pub_notification(apps, schema_editor): | ||
values_to_replace = [ | ||
'<p>Dear {{reviewer.full_name}}</p><p>An article that you served as peer reviewer for, \"{{ article.safe_title }}\", has been set for publication.<br><br>The article will be published on {{ article.date_published }}.<br><br>Regards,', | ||
] | ||
|
||
replacement_value = '<p>Dear reviewers,</p><p>An article that you served as peer reviewer for, \"{{ article.safe_title }}\", has been set for publication.<br><br>The article will be published on {{ article.date_published }}.<br><br>Regards,' | ||
|
||
migration_utils.update_default_setting_values( | ||
apps, | ||
setting_name='peer_reviewer_pub_notification', | ||
group_name='email', | ||
values_to_replace=values_to_replace, | ||
replacement_value=replacement_value, | ||
) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('journal', '0064_journal_default_editorial_team_image'), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name='fixedpubcheckitems', | ||
old_name='notify_the_author', | ||
new_name='send_notifications', | ||
), | ||
migrations.RunPython( | ||
replace_peer_reviewer_pub_notification, | ||
reverse_code=migrations.RunPython.noop, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters