macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
975 stars 347 forks source link

string index out of range #278

Closed cucy closed 7 years ago

cucy commented 7 years ago
IndexError at /accounts/activate/6ffd9b5ef4ff55fd6fce85bf9df79b8b6b5f1e42/
string index out of range

  File "/home/xxx/.pyenv/versions/reg_user3.5.3/lib/python3.5/site-packages/registration/models.py", line 549, in <listcomp>
    admins = [admin[1] for admin in admins]
joshblum commented 7 years ago

@cucy I think that your settings.py file is improperly written. Here is an example of what the ADMINS list must look like: https://github.com/macropin/django-registration/blob/master/test_app/settings_test.py#L54

Let me know if this fixes your issue!

joshblum commented 7 years ago

@cucy was this issue resolved with the change to settings.py?

ioparaskev commented 7 years ago

You could still consider this a minor bug due to the index 1 fixation. Maybe [admin[-1] for admin in admins] would be best and in this scenario (where it's obvious that there's an issue with the settings) there wouldn't be a problem

joshblum commented 7 years ago

The format of the setting is dictated by Django https://docs.djangoproject.com/en/1.11/ref/settings/#admins. I agree it would fix it in this case but think it's better to have the setting properly set for consistency/expectations of other code. @cucy I'm going to close this for now, let me know if you run into anything else!