fix user in user regexp

This commit is contained in:
Matthew Hodgson 2018-05-04 01:15:15 +01:00
parent 907a62df28
commit debf04556b

View File

@ -405,7 +405,7 @@ class RegisterRestServlet(RestServlet):
break
except SynapseError as e:
if e.errcode == Codes.USER_IN_USE:
m = re.match(r'^(.*)(\d+)$', desired_username)
m = re.match(r'^(.*?)(\d+)$', desired_username)
if m:
desired_username = m.group(1) + str(
int(m.group(2)) + 1