Skip to content

Commit

Permalink
Tested and added release process to readme, also some minor changes t…
Browse files Browse the repository at this point in the history
…o change confirm
  • Loading branch information
Thu Trang Pham committed Feb 10, 2021
1 parent d334ec6 commit c381eb4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ upload-testpypi:

i-have-tested-with-testpypi-and-am-ready-to-release:
python3 -m twine upload --repository pypi dist/django_admin_confirm-$(VERSION)*

install-testpypi:
python -m pip install --index-url https://test.pypi.org/simple/ django_admin_confirm
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,42 @@ pip install -e .
make run
```

### Release process

Honestly this part is just for my reference. But who knows :) maybe we'll have another maintainer in the future.

Run tests, check coverage, check readme, run tox

```
make test
make check-readme
tox
```

Update version in `setup.py`

```
make package
make upload-testpypi
```

Install new version locally
First you have to uninstall if you used `pip install -e` earlier

```
pip uninstall django_admin_confirm
make install-testpypi
```

Update version in `requirements.txt`
Add test locally

```
make run
```

Go on github and make a release in UI

## Feature List

This is a list of features which could potentially be added in the future. Some of which might make more sense in their own package.
Expand Down
3 changes: 3 additions & 0 deletions admin_confirm/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ def _change_confirmation_view(self, request, object_id, form_url, extra_context)
else:
# Parse the changed data - Note that using form.changed_data would not work because initial is not set
for name, field in form.fields.items():
# Since the form considers initial as the value first shown in the form
# It could be incorrect when user hits save, and then hits "No, go back to edit"
obj.refresh_from_db()
initial_value = getattr(obj, name)
new_value = getattr(new_object, name)
if (
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Django>=1.7.0
factory-boy~=3.0.1
django-admin-confirm~=0.2.1
django-admin-confirm~=0.2.2
coverage~=5.4
pytest~=6.2.2
tox~=3.21.4
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="django-admin-confirm",
version="0.2.1",
version="0.2.2",
packages=["admin_confirm"],
description="Adds confirmation to Django Admin changes, additions and actions",
long_description_content_type="text/markdown",
Expand Down

0 comments on commit c381eb4

Please sign in to comment.