-
-
Notifications
You must be signed in to change notification settings - Fork 34
Issue 311 #312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Issue 311 #312
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a303e49
Issue-311: changes
rsk2 e24bdc6
Issue-311: rename migration
rsk2 45194f6
Issue-311: rename migration
rsk2 72f600a
Issue-311: changes per review comments
rsk2 78a67fc
Merge branch 'master' of https://github.com/rsk2/Pytition into issue-311
rsk2 b534e4e
Issue-311: rearranging tests in tests_EditPetitionView.py
rsk2 50c7c9b
Issue-311: adding template tests
rsk2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
48 changes: 48 additions & 0 deletions
48
pytition/petition/migrations/0020_petition_has_email_share_button_and_more.py
This file contains hidden or 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,48 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-03 10:52 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0019_petition_show_publication_date'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_email_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_facebook_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_linkedin_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_mastodon_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_tumblr_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_twitter_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petition', | ||
| name='has_whatsapp_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| ] |
This file contains hidden or 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,27 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-03 16:26 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
| def set_new_petition_share_fields(apps, schema_editor): | ||
| Petition = apps.get_model("petition", "Petition") | ||
| for petition in Petition.objects.all(): | ||
| if petition.has_share_buttons: | ||
| petition.has_email_share_button = True | ||
| petition.has_facebook_share_button = True | ||
| petition.has_tumblr_share_button = True | ||
| petition.has_linkedin_share_button = True | ||
| petition.has_twitter_share_button = True | ||
| petition.has_mastodon_share_button = True | ||
| petition.has_whatsapp_share_button = True | ||
| petition.save() | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0020_petition_has_email_share_button_and_more'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(set_new_petition_share_fields) | ||
| ] |
17 changes: 17 additions & 0 deletions
17
pytition/petition/migrations/0022_remove_petition_has_share_buttons.py
This file contains hidden or 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,17 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-06 06:28 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0021_auto_20231203_1026'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveField( | ||
| model_name='petition', | ||
| name='has_share_buttons', | ||
| ), | ||
| ] |
48 changes: 48 additions & 0 deletions
48
pytition/petition/migrations/0023_petitiontemplate_has_email_share_button_and_more.py
This file contains hidden or 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,48 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-08 11:51 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0022_remove_petition_has_share_buttons'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_email_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_facebook_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_linkedin_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_mastodon_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_tumblr_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_twitter_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| migrations.AddField( | ||
| model_name='petitiontemplate', | ||
| name='has_whatsapp_share_button', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| ] |
This file contains hidden or 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,27 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-08 12:21 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| def set_new_petition_template_share_fields(apps, schema_editor): | ||
| PetitionTemplate = apps.get_model('petition', 'PetitionTemplate') | ||
| for pt in PetitionTemplate.objects.all(): | ||
| if pt.has_share_buttons: | ||
| pt.has_email_share_button = True | ||
| pt.has_facebook_share_button = True | ||
| pt.has_tumblr_share_button = True | ||
| pt.has_linkedin_share_button = True | ||
| pt.has_twitter_share_button = True | ||
| pt.has_mastodon_share_button = True | ||
| pt.has_whatsapp_share_button = True | ||
| pt.save() | ||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0023_petitiontemplate_has_email_share_button_and_more'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RunPython(set_new_petition_template_share_fields) | ||
| ] |
18 changes: 18 additions & 0 deletions
18
pytition/petition/migrations/0025_remove_petitiontemplate_has_share_buttons.py
This file contains hidden or 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,18 @@ | ||
| # Generated by Django 4.2.7 on 2023-12-09 06:02 | ||
|
|
||
| import colorfield.fields | ||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('petition', '0024_auto_20231208_0621'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.RemoveField( | ||
| model_name='petitiontemplate', | ||
| name='has_share_buttons', | ||
| ), | ||
| ] |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.