Commit graph

53 commits

Author SHA1 Message Date
Enric Caumons
5ad41df92c prevents crash when deleting user with attached avatars (fixes #52) 2013-09-10 01:19:29 +02:00
Jannis Leidel
b8844d8cd9 Merge branch 'master' of git://github.com/DrMeers/django-avatar into DrMeers-master
Conflicts:
	avatar/models.py
2013-05-27 10:13:16 +02:00
Brendon Crawford
8627f67046 Replace Django Hashcompat with Hashlib 2013-03-22 13:55:28 -07:00
Simon Meers
7ee83431b3 More quickly scrawled / untested custom user model support changes 2013-03-15 21:45:24 +11:00
Simon Meers
93fb42fd83 Commence experimental support for custom User models. 2013-03-15 21:29:07 +11:00
Mathieu Pillard
aac26b8c70 Add a get_absolute_url() method to help implementors (it needs to exists for projects to overwrite it)
Conflicts:
	avatar/models.py
2013-03-04 12:32:48 +01:00
Jannis Leidel
68731b6bc6 Merge remote-tracking branch 'chadpaulson/master'
Conflicts:
	MANIFEST.in
	avatar/models.py
	avatar/settings.py
	avatar/templatetags/avatar_tags.py
	avatar/views.py
	setup.py
2013-03-04 11:43:23 +01:00
Chad Paulson
b5937382ab Added post_delete signal to Avatar model in order to clean up the file system when AVATAR_MAX_AVATARS_PER_USER is equal to 1 or when Avatar instances are removed. This functionality is controlled by the new AVATAR_CLEAN_REMOVED setting which is False by default. 2013-01-18 19:39:31 -06:00
Jannis Leidel
264c83671a Fixed invalidating the avatar cache by making it happen post_save and post_delete. 2012-10-05 15:52:02 +02:00
Jannis Leidel
2650cf0282 Minor syntax cleanup. 2012-10-05 12:07:47 +02:00
Jannis Leidel
c8bf40ebe3 Catch IOError in the rest of the create_thumbnail method, too, to work around an issue with Django>1.4.1 which verifies the images being saved. 2012-10-05 12:07:13 +02:00
Jannis Leidel
7b0d9b4a9a Added ability to specify a custom storage backend. 2012-04-20 17:45:56 +02:00
Jannis Leidel
7913cb7a5c Use django.utils.timezone.now if needed. 2012-01-24 16:44:25 +01:00
Jannis Leidel
7f38a3acf5 Added new AVATAR_DEFAULT_SIZE setting with a default of 80. 2010-06-26 19:01:22 +02:00
Jannis Leidel
22b85c5028 Moved settings from avatar main module to own settings module and signal callback to models module to be able to prevent import errors in non-Django Python environments. 2010-06-26 19:00:31 +02:00
Jannis Leidel
17b183d315 Also invalidate the cache when deleting an avatar. 2010-06-26 17:20:29 +02:00
Jannis Leidel
1413c4000d Added template tag caching (default timeout: 60 minutes) to template tags, includes invalidation. 2010-06-26 16:49:35 +02:00
Jannis Leidel
92f9794701 Merge branch 'master' of git://github.com/alex/django-avatar 2010-06-24 18:02:32 +02:00
Alex Gaynor
4180a7a101 Fixes for Django 1.2 2010-06-24 10:56:04 -05:00
Mathieu Pillard
32b61553d2 Fix for issue #12 on ericflo/django-avatar, proposed by fakeempire
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2010-05-06 00:44:45 +02:00
Jannis Leidel
c240f23b86 Handle non-ASCII filenames correctly when hashing the filename. 2010-03-16 15:34:40 +01:00
Jannis Leidel
929c8a0e4f Added thumb quality setting which is used in the create_thumbnail() method. 2010-03-16 14:56:15 +01:00
PLHW
233422eefd adding default quality param to create_thumbnail
Signed-off-by: Jannis Leidel <jannis@leidel.info>
2010-03-16 14:31:25 +01:00
Eric Florenzano
111ecd8543 Obsessive compulsive import cleanup 2010-02-22 18:52:37 -05:00
Eric Florenzano
5648cb9f11 Cleanup, reorganization, moved the default avatar url to conform to community standards, and added a test to ensure that it's correct. 2010-02-22 18:48:22 -05:00
Eric Florenzano
3035f0adc8 Use PyFlakes to fix some fail 2010-02-22 16:47:10 -05:00
Mathieu Pillard
c364ca7aa1 Replace hashlib by django's md5_constructor 2010-02-22 16:36:55 -05:00
Eric Florenzano
2e55166df6 Fixed conflicts 2010-02-22 16:35:57 -05:00
Mathieu Pillard
ea8479d7bb Force thumbnail extension if AVATAR_HASH_FILENAMES is true. Avoids having
.jpg images that are really PNGs.
2010-02-22 16:33:56 -05:00
Mathieu Pillard
ce88c225ca Oops. 2010-02-22 16:33:14 -05:00
Mathieu Pillard
757283b823 Implement filename hashing (in case we don't want to blindly accept the filenames supplied by the user) and directory hashing (to allow
storage paths like /avatars/a/b/<user>/...)
2010-02-22 16:32:55 -05:00
Mathieu Pillard
aaeca7222e Thumbnails path simplification - /AVATAR_STORAGE_DIR/<user>/resized/<size>/<name> is enough. And this
method is more DRY, which will help when we'll implement the advanced storage path stuff
2010-02-22 16:32:22 -05:00
Mathieu Pillard
b2f3bec769 This time it should really work in every case... I hope. This really needs some unit tests. 2010-02-22 16:32:00 -05:00
Mathieu Pillard
2055adb46d This was needed too - basically, only enforce AVATAR_MAX_AVATARS_PER_USER in the form. 2010-02-22 16:31:36 -05:00
Mathieu Pillard
5621d867b1 use the user from the avatar instance 2010-02-22 16:31:28 -05:00
Mathieu Pillard
0b5674f008 Simplify image handling. Breaks the new AVATAR_DONT_SAVE_DUPLICATES setting but I will revisit it later in a cleaner way 2010-02-22 16:31:14 -05:00
Mathieu Pillard
8a680ecd66 Actually not a good idea at all :) Just don't bother updating and that's it. 2010-02-22 16:30:41 -05:00
Mathieu Pillard
dd1e3069ce Make thumbnail format configurable 2010-02-22 16:29:39 -05:00
Mathieu Pillard
a686c9b900 Don't use only(id) now that we are deleting instead of updating 2010-02-22 16:29:28 -05:00
Mathieu Pillard
188c4dece0 Deleting instead of updating for now 2010-02-22 16:29:19 -05:00
Mathieu Pillard
afde1c6268 special case for AVATAR_MAX_AVATARS_PER_USER == 1: try to work always on the same db row, by re-using the id. 2010-02-22 16:23:35 -05:00
Mathieu Pillard
731e580c91 Don't update the other avatars if the maximum is set to 1: it shouldn't happen. 2010-02-22 16:21:12 -05:00
Brian Rosner
737bf1d821 Removed some legacy code that is no longer used. Closes #1.
Due to catching the User post_save signal this would be fired on each login
since last_login is always updated.
2009-04-23 12:43:55 -06:00
Eric Florenzano
221b52a65c Fixed the apparent problem with PNG and S3 that some were seeing. Thanks, msaelices and bryanveloso. Along with that fix also comes support for not resizing an image if it's already the correct size.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@35 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-12-04 08:59:40 +00:00
Eric Florenzano
57c036ed39 Slightly shallower resized image paths.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@32 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-10-28 06:53:08 +00:00
Eric Florenzano
c3fadc0377 Completely refactored this package so that it no longer references the local filesystem. The API has been simplified and it has been tested with both file system backends and S3 backends. Gearing up for the first official release.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@30 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-10-28 06:39:21 +00:00
Eric Florenzano
ba8e3268fb Made all imports relative and cleaned up the imports in general. Thanks, PyFlakes!
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@29 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-10-20 01:11:10 +00:00
James Tauber
e8ff23bbb6 fixed force_insert problem
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@28 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-09-01 12:47:43 +00:00
Eric Florenzano
53a44ef2c0 Changed the max_length of the avatar ImageField, as we were seeing some errors about the path being too short.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@26 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-08-16 06:07:06 +00:00
Eric Florenzano
559eb4ae99 Fixed problem with uploading .GIF files, as they need to be conditionally converted to RGB.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@23 c76b2324-5f53-0410-85ac-b1078a54aeeb
2008-08-16 05:48:33 +00:00