4600 Commits

Author SHA1 Message Date
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
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
Jessica Tallon
283e6d8b9f Add polymorphic properties to User
This adds the ability to search for any user based on the generic
User case and be given back the specific LocalUser or RemoteUser.

This will require any code using the model to look which attributes
they are searching on and specify the specific User model they are
on if they're not on the generic User model. This will also require
new users to be created with LocalUser.
2015-07-31 15:14:41 +02:00
Jessica Tallon
aa9ba3ed80 Add LocalUser and RemoteUser and migration 2015-07-31 15:14:41 +02:00
Berker Peksag
b4b04522bf Regenerate po file after 8e832f84597bd1505f23f4abd4eef96ce12d3822 2015-07-22 11:24:49 +03:00
Berker Peksag
8e832f8459 Fix typos reported in #1102 2015-07-22 11:24:12 +03:00
Berker Peksag
47a2ab9cfc Return non-zero exit code if the command cannot be completed successfully.
Fixes #5084
2015-07-22 10:52:37 +03:00
Berker Peksag
e340879d3c Pin mock 1.0.1 in Python 2 for now.
mock recently dropped Python 2.6 support and then
re-introduced it in its latest release (however,
it's a bit unstable right now).

I think at this point, we can be more cautious
and just use mock==1.0.1.
2015-07-22 10:18:00 +03:00
Berker Peksag
896d00fbf2 Change all unicode() calls with six.text_type().
Fixes #5329.
2015-06-25 22:24:03 +03:00
Berker Peksag
a17845d42e Fix typo. 2015-06-25 16:03:30 +03:00
Berker Peksag
790f31e275 Fix more print statements. Refs #5331 2015-06-25 16:00:18 +03:00
Sebastian Spaeth
fe124c8979 Fix print statements to be python3 compatible. Refs #5331 2015-06-25 16:00:18 +03:00
Jessica Tallon
380ea91dab Merge branch Generic Foreign Key changes 2015-06-24 21:45:39 +02:00
Jessica Tallon
ddc2db746f Fix removal of ActivityIntermediatory migration
The migration had a problem where other tables still referenced the migration
as well as a typo in an earlier migration. They have both been fixed and tested
on PostgreSQL and SQLite3.

This also fixes a bug where sometimes when creating an activity it'd raise an
Exception as the object hadn't got an ID. This has been fixed globally with a
fix to the create_activity federation tool.
2015-06-24 21:43:16 +02:00
Berker Peksag
39da994058 Import urlparse from six.moves to work on both Python 2 and 3. 2015-06-05 19:45:00 +03:00
Christopher Allan Webber
853b74cd81 v0.8.0! Let's get this party started! 2015-06-04 08:30:54 -05:00
Christopher Allan Webber
30dbf9f524 More things to include in MANIFEST.in 2015-06-04 00:18:47 -05:00
Christopher Allan Webber
3169dde0c4 Note that users have to install node.js :\ 2015-06-03 22:15:11 -05:00
Christopher Allan Webber
270caff0d3 More adjustments to manifest.in
- include Makefile.in
 - include configure scripts
 - graft on devtools
2015-06-03 21:32:44 -05:00
Christopher Allan Webber
095c85972b We now store mediagoblin.example.ini, not mediagoblin.ini 2015-06-03 21:26:42 -05:00
Christopher Allan Webber
3801d51ca3 Committing extracted and compiled translations 2015-06-03 21:15:44 -05:00
Christopher Allan Webber
193c509bf1 Potentially require virtualenv as a requirement for "make dist" 2015-06-03 15:08:45 -05:00
Christopher Allan Webber
90dbaefb80 "make check" should work, and "make dist" should use setup.py 2015-06-03 14:21:37 -05:00
Christopher Allan Webber
eb8a6ba0cc Right, also don't build _version.py in configure.ac 2015-06-03 13:45:57 -05:00
Christopher Allan Webber
bc84e1882a readthedocs can't read the version using autotools, so back to _version.py specifying it 2015-06-03 10:36:33 -05:00
Christopher Allan Webber
e82c7edee5 Comment on why we're not using make dist... yet 2015-06-02 10:56:30 -05:00
Christopher Allan Webber
9bb2291aac Fix link from Gitorious -> Savannah 2015-06-01 14:06:43 -05:00
Christopher Allan Webber
f5ac2b61f7 Better phrasing: "Should I Keep Open Registration Enabled?" 2015-05-30 10:34:10 -05:00