97 Commits

Author SHA1 Message Date
Isaac Bythewood
a55644ba76 Start adding basic admin elements 2017-02-11 05:24:01 +00:00
Isaac Bythewood
af4e7437a3 self.url is not always set, return required fields for pin 2017-02-11 05:23:07 +00:00
Isaac Bythewood
d0db375d1f Remove unused RSS feed system, we aren't going to update it anymore 2017-02-11 04:57:00 +00:00
Isaac Bythewood
6bb7a96ddc Rework settings, add apps.py, preping for django 1.10 upgrade 2016-11-28 16:58:34 -05:00
Isaac Bythewood
5cb59746df Fixes issue #37 2016-02-04 19:48:31 +00:00
Isaac Bythewood
5802167b72 Fix bug in API now allowing delete or edit of pins 2016-02-04 01:34:19 +00:00
Carl van Tonder
1114edc11a Update to Django 1.8 and tastypie 0.12
Closes #38, closes #88
2015-08-26 17:22:08 -04:00
Jens Gutermuth
deb04500c5 Only use prefetched thumbnails if there are there
The optimization broke image uploading, this fixes it again.
2015-03-23 03:30:13 +01:00
Jens Gutermuth
9d4791b65a image can be loaded with a join as well (saves another query) 2015-03-23 02:30:54 +01:00
Jens Gutermuth
e4b8769168 DoesNotExist should be ObjectDoesNotExist, oops! 2015-03-23 02:28:21 +01:00
Jens Gutermuth
3bcc6d3152 Loanding pins does no N+1 queries anymore
This saves another three queries per pin, bringing to total query count
down to 8.

See issue #85 .
2015-03-23 02:22:35 +01:00
Jens Gutermuth
60cf2dcbd7 Fix three N+1 queries in pin loading
Fetch the submitter with a join and get all the images and tags in one
query each. This reduces the total query count for loading 50 pins from
304 to 158.

See issue #85.
2015-03-23 02:03:31 +01:00
Isaac Bythewood
d6c515ed0a Merge pull request #62 from tomwys/patch-2
Fix url regexp.
2014-07-21 23:54:29 -04:00
Krzysztof Klimonda
b79e6249ea Fixed tests not passing on postgresql. 2014-04-03 11:20:33 +02:00
Tomasz Wysocki
bd984f9fd2 Fix url regexp.
\d allows numbers from other digit systems, so urls like: http://demo.getpinry.com/१७/ are possible. This could lead to some nasty security issues in the future (ie. if you try to use pin number without using `int(...)`).
2014-04-03 11:12:39 +02:00
Tomasz Wysocki
25c02407ba "keys" is optional. 2014-04-03 10:09:11 +02:00
Isaac Bythewood
50d61af22a Move to bootstrap 3, better design, move all vendor items local. 2013-09-24 23:02:00 +00:00
Isaac Bythewood
795a905596 Added Original URL and Pin URL to lightbox of items. 2013-09-24 19:24:12 +00:00
Isaac Bythewood
a4f3adc2df Updated requirements and other items in preps of new pinry version 2013-09-22 03:33:50 +00:00
Isaac Bythewood
70a797c5af Update feeds to meet PEP requirements and minor adjustments to base.html 2013-09-22 00:32:52 +00:00
Isaac Bythewood
85d099fa94 Finish up feed implementation. 2013-09-21 05:21:17 -04:00
Isaac Bythewood
3affd088fa Adding rss feed for latest pins. 2013-09-21 04:28:41 -04:00
Krzysztof Klimonda
7db42bb075 Generate thumbnails when image is being saved
Too lax unique constraints for Thumbnail coped with "on demand" thumbnail
generation may leave database in inconsistent state where two thumbnail for
the same size are saved. We should be able to prevent that from happening
by generating all thumbnails when we save the image. Should fix #24, but
I can't figure out a way to actually test it.
2013-04-16 00:30:43 +02:00
Krzysztof Klimonda
c0bf9d992e Make sure that users can't impersonate each other when creating pins
We weren't checking if the Pin submitter is the logged user which made it possible
to pass any submitter to the Pin resource create call. Fix it, and make the submitter
optional.
2013-04-05 19:34:31 +02:00
Krzysztof Klimonda
3b10868832 Open binary files in the binary mode
Make sure that we are using binary mode to read binary files like images, this Fixes #20
2013-04-05 19:10:17 +02:00
Krzysztof Klimonda
e71452c68f Use a relative path for the test image
It's part of the issue #20 (weird path on Windows). Django File class used
a full file path which resulted in path like C:\Example\pinry\static\C:\... which
is obviously invalid.
2013-03-27 21:07:22 +01:00
Krzysztof Klimonda
fea9ea2f0e Commit an initial South migration.
It is a milestone of sort, from now on we're commited to write
correct two-way migrations for our code. It's one of the last
things to be done before an official v1.0 release.
2013-03-19 20:41:37 +01:00
Krzysztof Klimonda
494f7fbd8c Fix test by mocking requests.get function 2013-03-19 15:41:55 +01:00
Krzysztof Klimonda
98876bb0bd Use requests library instead of raw urllib2
This commit is a foundation upon a more robust image fetching code
will be built in the future, and it already fixes at least one weird
issue I've seen.
2013-03-19 15:22:20 +01:00
Krzysztof Klimonda
e0e0ac1679 Remove /by-md5/ prefix from image paths
Use forked django-images for now, until we can communicate with the
upstream about it. Fixes #4
2013-03-19 14:43:31 +01:00
Krzysztof Klimonda
4580a700ab Use media/ for files created during tests. Fixes #2 2013-03-05 01:58:11 -08:00
Krzysztof Klimonda
26b6805b6f Replace screenshot.png with logo.png in tests 2013-03-05 01:32:57 -08:00
Krzysztof Klimonda
10c9b35700 Even though not used, import models for Factory Boy 2013-03-05 01:28:39 -08:00
Isaac Bythewood
b63544905e Remove screenshot that is outdated and no longer needed, add full AGPL license and update api.py to use logo image instead of screenshot for testing 2013-03-05 01:53:46 +00:00
Krzysztof Klimonda
26f9c76988 Don't use FACTORY_FOR when not needed 2013-03-04 15:33:09 -08:00
Krzysztof Klimonda
7a85f1b514 Use post_generation hooks to populate models with some data
Factory Boy provides us with a better way of populating complicated
fields (like M2M relations) than overriding _prepare class method,
so we should be using them.
2013-03-04 14:58:54 -08:00
Krzysztof Klimonda
ef818b7f82 Rewrite tests to use a Model mocker library
There has been issues when running a full test suite (for pinry and
the entire Django stack), and test fixtures are hard to maintain anyway,
so rewrite tests to use a Model mocker library (Factory Boy) to populate
database.
2013-03-04 12:06:00 -08:00
Krzysztof Klimonda
856d2d1e87 Allow filtering pins over submitter.username 2013-03-03 14:51:19 -08:00
Isaac Bythewood
c7e1e1cd83 Move location of users middleware 2013-03-03 22:50:29 +00:00
Isaac Bythewood
248bd25a04 Move private to users, add user filtering to JS 2013-03-03 22:47:25 +00:00
Krzysztof Klimonda
cae9fa96be Write some more tests for all code 2013-03-03 10:09:33 -08:00
Krzysztof Klimonda
fbfd7e0239 CreateImage.get should always return HttpResponse 2013-03-03 10:08:26 -08:00
Krzysztof Klimonda
e5bd3d577d Clean-up PinResource.build_filters method 2013-03-03 09:11:26 -08:00
Krzysztof Klimonda
03e05906f8 Reorganize core package tests into modules 2013-03-03 09:10:42 -08:00
Krzysztof Klimonda
5b777b7e14 Move the Authentication backend to the users package 2013-03-03 09:09:13 -08:00
Krzysztof Klimonda
d0d68545ca Add "origin" field to the Pin model
"origin" is an optional field that stores the URI for the site
that the image has been saved from, it's going to be used only from
bookmarklet. Fixes #63
2013-03-03 08:25:42 -08:00
Krzysztof Klimonda
8c3599911e In PinResource.save_m2m do nothing when no tags 2013-03-03 06:22:16 -08:00
Krzysztof Klimonda
6e78ce12ea post-refactor test fixture update 2013-03-03 05:47:35 -08:00
Krzysztof Klimonda
995b69168b use old paths for pin urls 2013-03-03 05:19:19 -08:00
Krzysztof Klimonda
6e41296d57 Move test fixtures to the correct location 2013-03-03 04:59:44 -08:00