adaptive-learning / proso-apps

Django modules for an adaptive practice system (currently used by http://slepemapy.cz/ or https://anatom.cz/)
MIT License
2 stars 7 forks source link

load_flashcards fails after recent update #173

Closed slaweet closed 8 years ago

slaweet commented 8 years ago
Loading flashcards
[################################] 110/269 - 00:00:01
Traceback (most recent call last):
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/query.py", line 465, in get_or_create
    return self.get(**lookup), False
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/query.py", line 387, in get
    self.model._meta.object_name
proso_models.models.DoesNotExist: ItemRelation matching query does not exist.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/core/management/__init__.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/core/management/base.py", line 348, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/home/xstanis1/git/proso-apps/proso_flashcards/management/commands/load_flashcards.py", line 56, in handle
    self._load_flashcards(data["flashcards"], options['ignored_flashcards'])
  File "/home/xstanis1/git/proso-apps/proso_flashcards/management/commands/load_flashcards.py", line 233, in _load_flashcards
    db_flashcard.save()
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/base.py", line 700, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/base.py", line 737, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 192, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/xstanis1/git/proso-apps/proso/django/models.py", line 61, in wrapper
    signal_handler(*args, **kwargs)
  File "/home/xstanis1/git/proso-apps/proso_flashcards/models.py", line 342, in add_parent
    visible=True,
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/manager.py", line 122, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/query.py", line 467, in get_or_create
    return self._create_object_from_params(lookup, params)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/query.py", line 499, in _create_object_from_params
    obj = self.create(**params)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/query.py", line 401, in create
    obj.save(force_insert=True, using=self.db)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/base.py", line 700, in save
    force_update=force_update, update_fields=update_fields)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/db/models/base.py", line 737, in save_base
    update_fields=update_fields, raw=raw, using=using)
  File "/home/xstanis1/.virtualenvs/anatomy/local/lib/python3.5/site-packages/django/dispatch/dispatcher.py", line 192, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/xstanis1/git/proso-apps/proso_models/models.py", line 1485, in init_environment_relation
    environment = get_environment()
  File "/home/xstanis1/git/proso-apps/proso_models/models.py", line 69, in get_environment
    pass_parameters=[get_active_environment_info()['id']]
  File "/home/xstanis1/git/proso-apps/proso_common/models.py", line 96, in instantiate_from_config
    config = get_config(app_name, key, config_name=config_name, required=(default_class is None), default={})
  File "/home/xstanis1/git/proso-apps/proso_common/models.py", line 82, in get_config
    config = get_global_config(config_name).get(app_name)
  File "/home/xstanis1/git/proso-apps/proso_common/models.py", line 76, in get_global_config
    for key, value in current_custom_configs():
  File "/home/xstanis1/git/proso-apps/proso_common/models.py", line 51, in current_custom_configs
    if _custom_configs[currentThread()] is None:
KeyError: <_MainThread(MainThread, started 140523225564992)>