ednapiranha/remo — comment on commit f9d3d43a95ab144d263d52c37ee2fe91cfb47d4a
File: remo/profiles/models.py line 177
By glogiotatidis:

I agreed that this is not the most efficient way to do this. As we are really focused on UX we try to set a sane default value. The way this loop is designed we'll only loop if user's calculated display_name matches an existing one, which should rarely be the case. If that happens we append _'s until we find a unique username. I predict that should be on average just an extra hit on the database (i.e. we find a unique display_name on the first time) and max 14 hits on the db (extreme case, that 'll probably never happen) (note that we'll be expecting max 500 users in this website)

I understand that this is not optimal code / performance wise but it's optimal UX wise and I 'll like to keep it this way. Anyway since we are not expected to run into this situation a lot we can go either way. Let me know that you think it's best.