wger icon indicating copy to clipboard operation
wger copied to clipboard

Can't add exercises

Open i13-ctflora opened this issue 7 months ago • 3 comments

Priority/Impact

Medium (affects some functionality)

Description

I'm self-hosting wger. I have MIN_ACCOUNT_AGE_TO_TRUST=0 in my wger-local.env file, yet I still get this message when trying to add an exercise:

You can't contribute exercises
You can only contribute exercises if your account is older than 21 days and have verified your email

I've tried changing the MIN_ACCOUNT_AGE_TO_TRUST setting to several different values, but nothing seems to 'stick' - the error message always references '21' days regardless if it's set to 1, 20, or 100. Which leads me to believe that this setting is not getting read for some reason (or the error message is hard-coded to 21).

And I have confirmed that the user's email address is verified.

I've just installed it, so haven't been able to test if a user with over 21 days can add an exercise. That'll have to wait a few weeks, lol.

Use Case: I want to use wger to track my PT, and most of my PT stretching exercises aren't in the db. So I need to be able to add these exercises from day one. Also, it seems like a gym trainer should be able to add exercises at any time, so I tried setting that role, and still no change.

It looks like I can add exercises as the wger admin user, so I can do that for now.

Server version

2.4.0a1

Mobile app version

na

i13-ctflora avatar May 12 '25 16:05 i13-ctflora

I changed WGER_SETTINGS["MIN_ACCOUNT_AGE_TO_TRUST"] to "-1" in settings.py and it worked, where did you change the value?

But I confirm that the value displayed on the screen looks like hardcoded. I changed it to different values but "21" was displayed every time.

wbonicki avatar May 21 '25 12:05 wbonicki

I had the same issue. The check to see if the account is trustworthy, is here: https://github.com/wger-project/wger/blob/master/wger/core/models/profile.py#L397

What I did was:

  1. Set the var MIN_ACCOUNT_AGE_TO_TRUST to -1
  2. Change email_verified to True. Do this either in the django python shell or in the database.
  3. Log out and back in to the app. (I had to this because for some reason I still got the 21 days error).

Mystic-Ivy avatar Jun 10 '25 06:06 Mystic-Ivy

Not sure if it helps, but you can access directly the admin profile with, admin username and adminadmin password on a self hosted fresh install to have full admin control that also includes adding new exercises.

In case it helps

MrWeckx avatar Jul 25 '25 18:07 MrWeckx