Re: [PATCH 3/5] REST: Enable token auth support
On 10/06/17 03:25, Stephen Finucane wrote: Token authentication is generally viewed as a more secure option for API authentication than storing a username and password. Django REST Framework gives us a TokenAuthentication class and an authtoken app that we can use to generate random tokens and authenticate to API endpoints. Enable this support and add some tests to validate correct behavior. Signed-off-by: Andrew Donnellan Signed-off-by: Stephen Finucane Thanks for respinning this, was meaning to do so this coming week but you beat me to it! Will review the rest of the series tomorrow. -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnel...@au1.ibm.com IBM Australia Limited ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork
Re: [PATCH 3/5] REST: Enable token auth support
On Tue, 2017-06-13 at 00:04 +1000, Andrew Donnellan wrote: > On 10/06/17 03:25, Stephen Finucane wrote: > > Token authentication is generally viewed as a more secure option for API > > authentication than storing a username and password. > > > > Django REST Framework gives us a TokenAuthentication class and an authtoken > > app that we can use to generate random tokens and authenticate to API > > endpoints. Enable this support and add some tests to validate correct > > behavior. > > > > Signed-off-by: Andrew Donnellan > > Signed-off-by: Stephen Finucane > > Thanks for respinning this, was meaning to do so this coming week but > you beat me to it! Will review the rest of the series tomorrow. No worries - hope you don't me taking the leap there :) Looking forward to the reviews. Stephen ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork
pending triggers error with 'manage.py migrate'
I'm trying to upgrade an older patchwork instance I have, and it seems to be failing when I do a 'migrate' with the specific error: django.db.utils.OperationalError: cannot ALTER TABLE "patchwork_series" because it has pending trigger events I've made sure to update django-filter and django-filters to be up to date, along with Django. I must have missed a step somewhere, has this been seen before? Google search was not helpful, and my knowledge of Django is pretty thin. Thanks for any help, -Aaron ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork
Re: pending triggers error with 'manage.py migrate'
On Mon, 2017-06-12 at 12:53 -0400, Aaron Conole wrote: > I'm trying to upgrade an older patchwork instance I have, and it seems > to be failing when I do a 'migrate' with the specific error: > > django.db.utils.OperationalError: cannot ALTER TABLE "patchwork_series" > because it has pending > trigger events > > I've made sure to update django-filter and django-filters to be up to > date, along with Django. I must have missed a step somewhere, has this > been seen before? Google search was not helpful, and my knowledge of > Django is pretty thin. I'm thinking this is a DB error, rather than something Django-specific. Which backend are you using, and what migration is is failing on? The full output would be helpful. Cheers, Stephen ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork
Re: pending triggers error with 'manage.py migrate'
Hi Stephen, Stephen Finucane writes: > On Mon, 2017-06-12 at 12:53 -0400, Aaron Conole wrote: >> I'm trying to upgrade an older patchwork instance I have, and it seems >> to be failing when I do a 'migrate' with the specific error: >> >> django.db.utils.OperationalError: cannot ALTER TABLE >> "patchwork_series" because it has pending >> trigger events >> >> I've made sure to update django-filter and django-filters to be up to >> date, along with Django. I must have missed a step somewhere, has this >> been seen before? Google search was not helpful, and my knowledge of >> Django is pretty thin. > > I'm thinking this is a DB error, rather than something > Django-specific. Which backend are you using, > and what migration is is failing on? The full output would be helpful. Sorry for the terse message. Here's the full output [pwuser@mail patchwork]$ python3 ./manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, patchwork, sessions, sites Running migrations: Applying patchwork.0016_series_project...Traceback (most recent call last): File "/usr/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) psycopg2.OperationalError: cannot ALTER TABLE "patchwork_series" because it has pending trigger events The above exception was the direct cause of the following exception: Traceback (most recent call last): File "./manage.py", line 11, in execute_from_command_line(sys.argv) File "/usr/lib/python3.4/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/usr/lib/python3.4/site-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/usr/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 204, in handle fake_initial=fake_initial, File "/usr/lib/python3.4/site-packages/django/db/migrations/executor.py", line 115, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "/usr/lib/python3.4/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "/usr/lib/python3.4/site-packages/django/db/migrations/executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "/usr/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 93, in __exit__ self.execute(sql) File "/usr/lib/python3.4/site-packages/django/db/backends/base/schema.py", line 120, in execute cursor.execute(sql, params) File "/usr/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) File "/usr/lib/python3.4/site-packages/django/db/utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/lib/python3.4/site-packages/django/utils/six.py", line 685, in reraise raise value.with_traceback(tb) File "/usr/lib/python3.4/site-packages/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) django.db.utils.OperationalError: cannot ALTER TABLE "patchwork_series" because it has pending trigger events It's using postgres as the back-end (psycopg2 is the provider). Hopefully this tells you something :) -Aaron > Cheers, > Stephen ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork
Re: pending triggers error with 'manage.py migrate'
Hi Aaron, > I'm trying to upgrade an older patchwork instance I have, and it seems > to be failing when I do a 'migrate' with the specific error: > > django.db.utils.OperationalError: cannot ALTER TABLE "patchwork_series" > because it has pending trigger events Thanks so much for testing this - this is something I have been meaning to test for some time. I don't have any ideas off the top of my head but I will try to reproduce this locally and see how I go. My one question at the moment: what version of Patchwork are you upgrading from? 1.0? 1.1? something from git? Thanks again. Regards, Daniel > > I've made sure to update django-filter and django-filters to be up to > date, along with Django. I must have missed a step somewhere, has this > been seen before? Google search was not helpful, and my knowledge of > Django is pretty thin. > > Thanks for any help, > -Aaron > ___ > Patchwork mailing list > Patchwork@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/patchwork ___ Patchwork mailing list Patchwork@lists.ozlabs.org https://lists.ozlabs.org/listinfo/patchwork