4734 Commits

Author SHA1 Message Date
Christopher Allan Webber
a308306bcb Setting 0.8.2.dev in configure.ac as well 2015-12-20 11:11:07 -06:00
Christopher Allan Webber
7f5a8e1c38 Setting version to v0.8.2.dev 2015-12-20 11:10:30 -06:00
Christopher Allan Webber
ca3dd10e2b Fixing typo (thanks breton) 2015-12-20 10:58:43 -06:00
Christopher Allan Webber
9b9c04e6ac 0.8.1 release notes 2015-12-20 09:53:25 -06:00
Christopher Allan Webber
76a8e720e5 Merge branch 'stable' 2015-12-20 09:05:00 -06:00
Jessica Tallon
86ee2d1a0e Fix security issue in OAuth verifier validation 2015-12-19 22:16:00 -06:00
Christopher Allan Webber
86d01f0816 Merge branch 'stable'
Conflicts:
	mediagoblin/i18n/templates/en/mediagoblin.po
	mediagoblin/plugins/archivalook/tools.py
2015-12-19 21:57:27 -06:00
Jessica Tallon
f1db51e4db Fix bug on the OAuth client deauthorization page
An exception was raised when a user tried to go to the authroization page
this occured when we changed the field names on the models from "user" to
actor. This patch corrects the query and resolves the error.
2015-12-20 01:54:55 +00:00
ayleph
6e38fec80e Fix Issue 5375 Deprecated function in video thumb
This patch fixes issue 5375 by replacing a function call that has
been removed in recent versions of PIL with the recommended
replacement.

(cherry picked from commit 564a48e018bcd786aa32b232cb7216be3ef3fb5e)
2015-12-20 00:51:13 +03:00
ayleph
564a48e018 Fix Issue 5375 Deprecated function in video thumb
This patch fixes issue 5375 by replacing a function call that has
been removed in recent versions of PIL with the recommended
replacement.
2015-12-20 00:47:02 +03:00
Christopher Allan Webber
13f187992a Kludgey documentation fix so that python 2 does not break with flup
See also Issue #5373
2015-12-14 14:19:20 -06:00
Ben Sturmfels
e61dea3b05 Add "Add media" button on home page when no media is present.
This is an addition to the button hidden in the top toolbar.
2015-12-10 11:33:10 -06:00
Christopher Allan Webber
600a170ecf Fix issue #5372: test_comment_notification fails with werkzeug 0.11 or newer
Formerly like:
   chris commented on your post (​http://localhost:80/u/otherperson/m/some-title/c/1/#comment) at GNU MediaGoblin

With werkzeug 0.11.0 or higher:
    chris commented on your post (​http://localhost/u/otherperson/m/some-title/c/1/#comment) at GNU MediaGoblin

Easy enough just to be flexible.
2015-12-10 11:29:20 -06:00
ayleph
e2b44bd7a7 Fix issue 983 PDF UnicodeDecodeError
Parse PDF lines as unicode to prevent UnicodeDecodeError when a
non-ASCII character is encountered.
2015-12-10 11:11:42 -06:00
Jessica Tallon
fd07dd6da9 Fix #5363 - Collections don't serialize correctly 2015-11-25 14:57:46 +00:00
Jessica Tallon
0d053bff98 Added test for #5356 - Read someone else's feed
This adds a test and improves a previous test for the ability to read
someone elses feed. Previously it was not possible however this has
since been patched and this test checks for that.
2015-11-24 10:45:23 +00:00
ayleph
34f1d8a264 Allow API client to GET another user's outbox
Signed-off-by: Jessica Tallon <tsyesika@tsyesika.se>
2015-11-24 10:00:26 +00:00
Jessica Tallon
89068c2bdb Fix #5354 & #5355 - Fix Graveyard.serialize
Graveyard.serialize raised an exception as the deleted datetime
objects where not being converted to strings for json encoding. It
also didn't deal with the case when there was an actor, it now calls
the actor's serialize method as it should.

Thanks to Alyeph who provided the patches for both of these.
2015-11-23 17:27:32 +00:00
ayleph
fb071a38fe Use urljoin to create proper feed media URLs 2015-11-19 16:16:40 -06:00
ayleph
ba6d2d7e78 Fix for issue 5070 gst incomplete file
Seek tmp_media_file to 0 before attempting to discover the file type.
This prevents the following error when discovering mp4 video files.

"gst-stream-error-quark: This file is incomplete and cannot be played"
2015-11-19 16:05:25 -06:00
Daniel Krol
17eb7786b6 Fix add collection view for new schema 2015-11-09 00:13:53 -08:00
Ben Sturmfels
5acbb79da5 Fix minor grammatical error 'settings' -> 'setting'. 2015-11-05 15:54:12 -06:00
Ben Sturmfels
82c181f0c7 Remove <br/> from safe string indicating that CSRF cooking is missing. 2015-11-05 15:54:11 -06:00
Ben Sturmfels
68c963d6f5 trac#687: Add unit tests for redirect and redirect_obj. 2015-11-05 15:43:41 -06:00
Christopher Allan Webber
6557bab6f1 Switch to webtest >= 2.0.18 2015-11-05 15:32:51 -06:00
Ben Sturmfels
f51fd67a06 trac#665: Upgrade to WebTest 2.0.18 and fix broken test test_csrf_cookie_set.
Test was failing due to API change in WebTest around accessing cookies set in the test client. These are now in `test_app.cookies`.

While there are currently 48 other tests failing, I've verified that before and after this change that the same number fail. I've also checked that no other tests use the old API for accessing test client cookies.

I've pinned to version 2.0.18. My understanding is that it's generally a good idea to pin to a specific version where possible to avoid the "why has this suddenly broken" type bugs. This also seems appropriate since WebTest appears to be very stable.
2015-11-05 15:13:44 -06:00
Ben Sturmfels
be2621a43c Prevent unhandled exception on non-existant user.
These changes bring `makeadmin` and `changepw` in-line with the approach used in `deleteuser`.

I've also made the error messages more consistent: list the username and full sentences.
2015-11-05 14:49:36 -06:00
Jessica Tallon
03bb1b7907 Merge branch 'comments' 2015-10-20 13:02:15 +00:00
Jessica Tallon
64a456a4e5 Comment changes for federation
This adds a new Comment link table that is used to link between some
object and then the comment object, which can be more or less any
object in Mediagoblin. The MediaComment has been renamed to
TextComment as that more aptly describes what it is. There is
migrations for these changes.

There is also the conslidation of the Report tables into a single
Report table, the same with the Notification objects. This is because
both of them split out MediaEntry and Comment versions into their own
polymorphic versions from a base, this is no longer a meaningful
distinction as comments can be anything.
2015-10-20 12:24:54 +00:00
Jessica Tallon
fd703bb4d0 Fix #5353 - Bug in OAuth which referenced "user"
There was a recent change in 0f3bf8d where several names which were
used to refer the actor where renamed to the standard "actor"
property name. There were some places in the OAuth decorator and the
OAuth views where the old names were still referred. This fixes that.
2015-10-17 00:18:32 +00:00
Jessica Tallon
d216d771f6 Add public_id fixes throughout the code
This adds several things, mainly code which checks for the public id and
if it doesn't exist generating it where it can. This is to because we
need to keep the public_id to be able to effectively soft delete models.

This also adds a public_id field to the Activity along with a migration.
2015-10-07 15:07:54 +02:00
Jessica Tallon
bc75a65327 Add Graveyard model
This adds the Graveyard model which is used when a model is deleted, it
stores the important "shell" information on the model so it can
hard-delete the real object. It also remaps the GenericModelReference
references to the new Graveyard model.

This also moves the soft deletion setting from __model_args__ to
"deletion_mode" on the model.
2015-10-07 14:40:44 +02:00
Jessica Tallon
30852fda1c Add the __model_args__ deletion code
This adds the "deleted" fields to the models as well as a new
__model_args__ section whcih supports the option for changing the
deletion type. Deletion is now handled by choosing a deletion method
based on the __model_args__["deletion"] setting, for example if it's
soft deletion it will call Model.soft_delete()
2015-10-07 14:40:44 +02:00
Jessica Tallon
0f3bf8d4b1 Collection changes and migration for federation
- Adds a "type" column to the Collection object and allows the
CollectionItem model to contain any object.
- Changes "items" to "num_items" as per TODO
- Renames "uploader", "creator" and "user" to a common "actor" in most places
2015-10-07 14:40:44 +02:00
Jessica Tallon
80ba8ad1d1 Fix bugs with the exifread library update
- As of version 2.1.2 of exifread the 90 CW and 90 CCW values were
  swapped, this bug is now fixed however our test data had those values
  swapped too. I have fixed that.

- I also noticed that I had different orientation values, this was
  noticed and fixed for some other differing values in commit ccca39f1
  when it was decided we'll add values which were noticed on different
  platforms.
2015-10-07 13:52:30 +02:00
Ben Sturmfels
17f5902a4c Fix #994: Also set self.data when no change made to URL.
This partially reverts 2a1082e3
2015-09-08 13:22:55 +03:00
Berker Peksag
2a1082e3dc Use StringField.process_formdata() if valuelist is empty. 2015-08-25 03:44:02 +03:00
Ben Sturmfels
75dc254c65 Fix #994: Don't require users to type the website URL scheme when updating profile.
Adds 'http://' if no scheme is provided. Eg. If you enter
'www.example.com', this will be updated to 'http://www.example.com'.
2015-08-25 03:36:59 +03:00
Ben Sturmfels
bfbd09007a Issue #815: Replace two non-ASCII curly single quotes with straight quotes.
I don't think there's necessarily anything wrong with using non-ASCII
characters, since UTF-8 is basically the de facto standard. There's no
reason to mix a small number of curly quotes into a configuration file
though, so I've replaced them for consistency.
2015-08-25 03:19:17 +03:00
Jessica Tallon
b4997540dc Fix some unit tests and bugs
This fixes a lot of the issues with the LocalUser changes that were
merged recently. There was a problem where the attributes of LocalUser
were not being eagerly loaded and because the Session was detached an
exception was being raised when they were accessed.

This also fixes some typo's which were introduced.

Finally this adds a temporary fix for a potential SQLAlchemy bug, this
is a bug where doing:

    User.query.filter(LocalUser.username == "some_username").first()

does NOT yeild a user with the username "some_username" but all users
on the site. The temp fix is to just query the LocalUser, this should
be resolved when bug is confirmed and fixed upstream.
2015-08-24 21:07:06 +02:00
Jessica Tallon
e9bb5879f7 Fix #5344 - OAuth NotImplemented exception
This introduces a migration which adds a dummy Client, RequestToken
and AccessToken. These are used when an invalid request comes in,
instead of bailing early, it needs dummy data to prevent timing
attacks.

This then implements the methods which get the IDs of the dummy
objects. If these are changed in the future a migration which checks
for the previous dummy object should be created and updates them to
reflect the new IDs/tokens.
2015-08-21 17:57:39 +02:00
Jessica Tallon
3b4ad554c7 Fix #1066 - OAuth Invalid signature error
It seems that the GET params on a URL should be included when
one signs the request. Mediagoblin was just using the base URL
without them. This should fix that.
2015-08-20 13:20:48 +02:00
Jessica Tallon
de366f735a Fix serialization after model changes
After the recent model changes there were some bugs which were
introduced into the serialization methods of the models. This commit
fixes those issues.
2015-08-20 11:31:50 +02:00
Jessica Tallon
35fbad47d7 Change structure of MediaEntry and add migration
This makes the changes needed for federating MediaEntry objects as well
as adding the migration and necessary methods to get the public_id just
in time (JIT).
2015-08-19 17:18:37 +02:00
Jessica Tallon
c9f6afe291 Change codebase to query or create correct User model
The code base had many references to User.username and other
specific to LocalUser attributes as that was the way it use to exist.
This updates those to query on the generic User model but filtering
by attributes on the LocalUser.
2015-08-19 15:37:27 +02:00
Duncan
f0a4c3475f Add a no_referrer setting to prevent browsers leaking information. 2015-08-02 06:52:04 +03:00
Berker Peksag
e2a8d30307 Fix urlparse import in tools/routing.py
urlparse is already a function, so we don't need to specify
a module name.

Refs #5339
2015-08-01 05:05:52 +03:00
Berker Peksag
750ddf32b5 Fix urlparse import in tools/routing.py
urlparse is already a function, so we don't need to specify
a module name.

Refs #5339
2015-08-01 05:05:07 +03:00
Jessica Tallon
d7f35f6fbe Add the user models to the MODELS list
This adds the two new user models (LocalUser and RemoteUser) to the
MODELS list that is in models.py. This stops the strange bug that occurs
if you migrate a fresh database, the two models don't exist however
migrating an existing database would create them as the migrations
exist.
2015-07-31 15:15:24 +02:00
Jessica Tallon
d88fcb03e2 Change codebase to query or create correct User model
The code base had many references to User.username and other
specific to LocalUser attributes as that was the way it use to exist.
This updates those to query on the generic User model but filtering
by attributes on the LocalUser.
2015-07-31 15:15:24 +02:00