bdragon300 / mongoengine-migrate

Migrations for MongoEngine inspired by Django
Apache License 2.0
17 stars 5 forks source link

Fix email regex in `to_email_string` converter #24

Closed bdragon300 closed 3 years ago

bdragon300 commented 3 years ago

Now the format of email string does not check. It's needed to fix regex.

vmdhhh commented 3 years ago

@bdragon300 Can you please describe the issue a bit? I would like to help if i can and if its ok.

bdragon300 commented 3 years ago

Hi @vmdhhh . This issue is about to add email format check in to_email_string converter. It located in mongoengine_migrate.fields.converters.common. It's needed to add regex which checks if string field value in documents of given collection has email format. Now only .* regex there, i.e. no check.

Pay attention that this regex will be executed by MongoDB query, not in python. This regex should not be very complex to avoid possible performance issues. Just brief check.

to_email_string invokes when field converts to EmailField from string or dynamic field.

vmdhhh commented 3 years ago

@bdragon300 Please take a look at the #34 and let me know.

vmdhhh commented 3 years ago

@bdragon300 I also figured out the resolution for #33 . Do you want me to add the change in this PR ?

bdragon300 commented 3 years ago

@vmdhhh I think it should be a separate PR

bdragon300 commented 3 years ago

Fixed