| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
This removes some 'u' prefixes and converts simple format() calls to f-strings.
|
|
|
|
|
|
|
| |
There was an existing stub for `gmg serve`, but had never been completed.
This will make it simpler to run the MediaGoblin web interface and media
processing backend.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
To avoid issues with quotes, I've replaced the manual CSV handling with
csv.DictReader and simplified the unicode handling down to a single line. I
don't believe any special encoding is required when writing to the database.
This has been tested by importing a CSV with braille characters on Python 3 and
Python 2.
|
| |
|
|
|
|
|
| |
The command was raising "io.UnsupportedOperation: seek" for URL-based imports
and didn't support HTTPS.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Make the batchaddmedia command look for a 'collection-slug' column, that
for each row may specify the slug of a collection that the media should
be added to. This matches the '--collection-slug' argument of the
addmedia command.
|
|
|
|
|
| |
Remove an unused import and an unused local variable from
batchaddmedia.py.
|
|
|
|
|
|
|
|
|
|
| |
After alembic updates we need to add foundations. The tables to add
foundations to are created as part of dbupdate process. For some reason
Alembic doesn't commit a session in the end. Because the session is not
commited, the tables do not really get created. And because of that,
foundations fail.
The solution is to commit the session after alembic updates.
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
mediagoblin/submit/lib.py -- happened because of creator->actor
change
Fixes issue #915
|
| | |
|
| |
| |
| |
| | |
Signed-off-by: Loic Dachary <loic@dachary.org>
|
| |
| |
| |
| | |
Fixes #5441
|
| |
| |
| |
| |
| |
| |
| | |
* mediagoblin/gmg_commands/dbupdate.py (run_foundations):
When adding a plugin's foundations, correctly append both
the name and the foundations in a tuple to the list.
This prevents errors.
|
| |
| |
| |
| |
| | |
* mediagoblin/gmg_commands/alembic_commands.py (FudgedCommandLine.main):
Removed call to print.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows plugin writers to easily take advantage off alembic's migration
autogeneration support.
* mediagoblin/gmg_commands/alembic_commands.py: Adjusted imports.
(FudgedCommandLine.main, parser_setup): Add support for importing
plugins when --with-plugins is passed in.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The goal is to get things to the point where Alembic can run on its own
for new databases and initialize the whole database on its own. There
are risks to not doing so, see #5413 for details.
There's a lot more here that could removed or cleaned up once
sqlalchemy-migrate is *completely* removed in the future.
* mediagoblin/db/migration_tools.py (MigrationManager.foundations):
Removed attribute.
(MigrationManager.populate_table_foundations): Removed method.
(MigrationManager.init_or_migrate): Removed call to deprecated method.
(populate_table_foundations): New function, refactored from former
MigrationManager method of same name.
* mediagoblin/gmg_commands/dbupdate.py: Import populate_table_foundations.
(DatabaseData.foundations): Remove attribute.
(DatabaseData.make_migration_manager): Adjust instantiation of
MigrationManager.
(gather_database_data): Move out the work of building up foundations data.
(run_foundations): New method, incorporating logic for gathering and
running foundations which was previously spread across other
functions and methods.
(run_alembic_migrations): Remove deprecated comment.
(run_dbupdate): Only run sqlalchemy migrations if we have to.
Also run run_foundations if we are setting up this database for the
first time.
(sqam_migrations_to_run): New method.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This makes use of the recently added "build_alembic_config" tool and
removes AlembicMigrationManager.
* mediagoblin/db/migration_tools.py (AlembicMigrationManager): Removed.
* mediagoblin/gmg_commands/dbupdate.py (run_alembic_migrations):
Adjusted to use recently added build_alembic_config tool.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
gmg_commands.alembic attempted to import from `alembic`. On python2.7
it resulted in import from itself.
Rename alembic.py to alembic_commands.py and fix references to
gmg_commands.alembic.
|
| | |
|
| |
| |
| |
| |
| | |
This allows you to dispatch to the "alembic" command line tool properly,
but properly respecting MediaGoblin's own configuration.
|
| |
| |
| |
| |
| | |
Incredibly, it looks like none of our documentation has to change taking
this route...!
|
| | |
|
| |
| |
| |
| |
| |
| | |
Enable alembic for all migrations and limit the max number of
sqlalchemy-migration migration. All new migrations must now be in
Alembic!
|
| |
| |
| |
| | |
Sorry, cannot look at them without urge to fix
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
- 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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Fixes #5084
|
| |
| |
| |
| | |
Fixes #5329.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This means that we have a really convenient way to make sure that you
have a context/request that threads its way through the application,
where everything needed gets "shut down" appropriately by the end.
You always get a context object via a context manager! And by the time
you're done with it, things should be cleaned up.
|
| | |
|
| |
| |
| |
| | |
This commit sponsored by Ray Redd. Thanks!
|
| | |
|
| |
| |
| |
| |
| | |
This is to prevent our docs from confusing people in this
transitionary time period...
|
| | |
|
| | |
|
| |
| |
| |
| | |
We want to make sure it works nicely first.
|
|\ \
| | |
| | |
| | |
| | | |
Conflicts:
setup.py
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Has some issues, will iteratively fix!
Conflicts:
mediagoblin/gmg_commands/__init__.py
mediagoblin/gmg_commands/deletemedia.py
mediagoblin/gmg_commands/users.py
mediagoblin/oauth/views.py
mediagoblin/plugins/api/views.py
mediagoblin/tests/test_api.py
mediagoblin/tests/test_edit.py
mediagoblin/tests/test_oauth1.py
mediagoblin/tests/test_util.py
mediagoblin/tools/mail.py
mediagoblin/webfinger/views.py
setup.py
|
| | |
| | |
| | |
| | | |
This is partly port from PasteScript.
|