Skip to content
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

Update pupa clean so that Jurisdiction, Division, and Post objects are not deleted #354

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

hancush
Copy link
Contributor

@hancush hancush commented Sep 11, 2024

Description

See title. Divisions and Posts are unchanging and should not be removed by the clean command!

@@ -18,7 +18,7 @@
entry_points='''[console_scripts]
pupa = pupa.cli.__main__:main''',
install_requires=[
'Django>=2.2',
'Django>=2.2,<5',
Copy link
Contributor Author

@hancush hancush Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index_together (used by python-opencivicdata, I guess) was removed in Django 5.

Comment on lines +12 to +16
'NAME': os.getenv('POSTGRES_DB', 'test'),
'USER': os.getenv('POSTGRES_USER', 'test'),
'PASSWORD': os.getenv('POSTGRES_PASSWORD', 'test'),
'HOST': os.getenv('POSTGRES_HOST', 'localhost'),
'PORT': os.getenv('POSTGRES_PORT', 5432),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow for setting these as environment variables, useful for, e.g., if you are running Postgres in a container.

@@ -118,23 +134,25 @@ def test_clean_command_failsafe(subparsers, organization, person):
for p in stale_people:
p.memberships.create(organization=organization)

cmd = CleanCommand(subparsers)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest complained when this was instantiated multiple times.

@coveralls
Copy link

Coverage Status

coverage: 94.816%. remained the same
when pulling 9087629 on hcg/protect-post
into a6517de on master.

2 similar comments
@coveralls
Copy link

Coverage Status

coverage: 94.816%. remained the same
when pulling 9087629 on hcg/protect-post
into a6517de on master.

@coveralls
Copy link

Coverage Status

coverage: 94.816%. remained the same
when pulling 9087629 on hcg/protect-post
into a6517de on master.

Copy link
Collaborator

@antidipyramid antidipyramid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

@hancush hancush merged commit 2f7847c into master Sep 11, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants