Commit graph

607 commits

Author SHA1 Message Date
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
67361f3933 Remove vestigial import 2010-02-22 18:19:22 -05:00
Eric Florenzano
2ef99bc3c1 Moved default.jpg to reflect the community standard for media files 2010-02-22 18:19:08 -05:00
Eric Florenzano
1fb5b47ca0 Add a clarifying comment 2010-02-22 18:08:01 -05:00
Eric Florenzano
5469668e22 Remove an accidental pyc file checkin 2010-02-22 17:53:19 -05:00
Eric Florenzano
8020c5b256 Add a .gitignore 2010-02-22 17:52:58 -05:00
Eric Florenzano
cf667a2c9d Added the ability to run the tests in a standalone way. 2010-02-22 17:52:01 -05:00
James Turnbull
acdd9539ae Moved template folder to correct name (notification) 2010-02-22 16:55:14 -05:00
James Turnbull
08a30aa851 Cleaned up noticetext, removing reference to the user's gender and nonsense regarding tribes 2010-02-22 16:54:59 -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
Mathieu Pillard
984131894b Allow extra args that might be sent to the views. Useful with custom URLConf for instance. 2010-02-22 16:36:45 -05:00
Mathieu Pillard
b8341f916b fix resize for render_primary: size is a string, we need to convert it to an integer. 2010-02-22 16:36:35 -05:00
Mathieu Pillard
8cd775a41f render_primary() needs AVATAR_DEFAULT_URL 2010-02-22 16:36:23 -05:00
Eric Florenzano
2e55166df6 Fixed conflicts 2010-02-22 16:35:57 -05:00
Mathieu Pillard
628948f8ed Marking added strings for translation and providing a basic french translation 2010-02-22 16:34:19 -05:00
Mathieu Pillard
e5b81caaff Lowercase filename just in case. 2010-02-22 16:34:11 -05:00
Mathieu Pillard
7bd5972aeb Implement a basic file extension validation system. 2010-02-22 16:34:04 -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
e86823251b Use pretty decorators 2010-02-22 16:33:47 -05:00
Mathieu Pillard
0b9a075070 More basic tests 2010-02-22 16:33:39 -05:00
Mathieu Pillard
837bdadd31 Adding basic tests 2010-02-22 16:33:25 -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
3c3ffad9c3 Will revisit that later, it's not a big issue 2010-02-22 16:32:30 -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
84aa3b84d3 irrelevant now 2010-02-22 16:31:52 -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
b7811b3d14 is a boolean 2010-02-22 16:30:14 -05:00
Mathieu Pillard
763745c4cb if AVATAR_DONT_SAVE_DUPLICATES is enabled don't generate a thumbnail over an existing one 2010-02-22 16:30:05 -05:00
Mathieu Pillard
5e804236a8 new preference allowing to re-use existing file if it exists. might have concurrency issues since
we don't ask the database if it exists, only the storage system, so it might break if it's being
deleted at the same time
2010-02-22 16:29:58 -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
e96db94b02 debugging, not needed 2010-02-22 16:29:08 -05:00
Mathieu Pillard
7a6c2e04a9 This method is more closer to the original and should be more robust even if you change the max number of avatars 2010-02-22 16:28:58 -05:00
Mathieu Pillard
fe2fe0c1c3 Oops, need to actually get the first item of the queryset 2010-02-22 16:27:54 -05:00
Mathieu Pillard
b4646e5b5f More robust way of fetching the current avatar - still needs some testing 2010-02-22 16:27:21 -05:00
Mathieu Pillard
3b04839078 Better wording 2010-02-22 16:26:20 -05:00
Mathieu Pillard
32b5d5f55f Don't use notification if the module is not present (probably broke that when refactoring notifications) 2010-02-22 16:26:04 -05:00
Mathieu Pillard
e0654c8d57 Implement a max size for the avatars. Defaults to 1 megabyte for now. 2010-02-22 16:25:09 -05:00
Mathieu Pillard
470b90be4a Useless print 2010-02-22 16:24:56 -05:00
Mathieu Pillard
84b68d4284 Not needed 2010-02-22 16:24:46 -05:00
Mathieu Pillard
1aaaac1ce0 Fixed now 2010-02-22 16:24:36 -05:00
Mathieu Pillard
04a5a271de Use our uploadform in the templates 2010-02-22 16:24:17 -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