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

Added new exercise - untranslated - now have a broken install. "An error occurred" #72

Open
ranasats opened this issue Dec 11, 2023 · 1 comment

Comments

@ranasats
Copy link

Hi,

Looking through logs I see this message:

wger_server  | System check identified some issues:
wger_server  | 
wger_server  | WARNINGS:
wger_server  | ?: (wger.W002) exercises without translations
wger_server  |  HINT: There are 1 exercises without translations, this will cause problems! You can output or delete them with "python manage.py exercises-health-check --help"

I did the following after looking through the docs:

docker exec web python3 manage.py exercises-health-check --delete-untranslated

This throws an error:


INFO 2023-12-11 02:57:19,945 apps AXES: BEGIN version 6.1.1, blocking by ip_address
System check identified some issues:

WARNINGS:
?: (wger.W002) exercises without translations
        HINT: There are 1 exercises without translations, this will cause problems! You can output or delete them with "python manage.py exercises-health-check --help"
Exercise a97ba0cb-8077-4e08-8590-3328e1dfdcd5 has no translations!
Traceback (most recent call last):
  File "/home/wger/src/manage.py", line 25, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.10/dist-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/home/wger/src/wger/exercises/management/commands/exercises-health-check.py", line 91, in handle
    self.handle_untranslated(base, delete_untranslated)
  File "/home/wger/src/wger/exercises/management/commands/exercises-health-check.py", line 104, in handle_untranslated
    base.delete()
  File "/home/wger/src/wger/exercises/models/base.py", line 254, in delete
    comment=f"Exercise base of {self.get_exercise(ENGLISH_SHORT_NAME).name}",
AttributeError: 'NoneType' object has no attribute 'name'

So essentially I now have a broken install, I can't do anything (add new workouts, templates, exercises, etc).

How can I remove the new exercise I just added? Also, how do I prevent this in the future, just add a 'fake' translation?

Thanks!

@ranasats
Copy link
Author

Deleted my database (brand new install, so nothing lost) and tried again. This time I added a 'fake' spanish translation which was just the same text again but this time under "spanish".

Same error as above has happened. Not sure how I can go about adding a new exercise... Any tips? I did notice as soon as I hit submit on the new exercise, the button that says "submit exercise" greys out and I get an error on my log:

wger_server | WARNING 2023-12-11 10:47:30,442 log Bad Request: /api/v2/exercise-translation/

And then the usual error that's called above shows up whenever i try to remove the untranslated exercise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant