Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to add an admin in cli (due to ACL) #101

Open
C4ptainCrunch opened this issue Jun 7, 2012 · 0 comments
Open

Impossible to add an admin in cli (due to ACL) #101

C4ptainCrunch opened this issue Jun 7, 2012 · 0 comments
Labels
Milestone

Comments

@C4ptainCrunch
Copy link
Contributor

On a (fresh) local install

$ ./manage.py shell
Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.contrib.auth.models import User
>>> u = User.objects.get(pk=1)
>>> from users.models import PERM_LIST, Permission
>>> for p in PERM_LIST: Permission.objects.create(name=p, user=u)
... 
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/manager.py", line 137, in create
    return self.get_query_set().create(**kwargs)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/query.py", line 377, in create
    obj.save(force_insert=True, using=self.db)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/base.py", line 551, in save_base
    result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/manager.py", line 203, in _insert
    return insert_query(self.model, objs, fields, **kwargs)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/query.py", line 1576, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 910, in execute_sql
    cursor.execute(sql, params)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/backends/util.py", line 40, in execute
    return self.cursor.execute(sql, params)
  File "/Users/nikitamarchant/Code/proj402/ve/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 337, in execute
    return Database.Cursor.execute(self, query, params)
IntegrityError: users_permission.object_id may not be NULL
>>> 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant