25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

16 lines
638 B

  1. import json
  2. from api import models
  3. def create_password_with(entry):
  4. settings = json.dumps(entry.password.settings)
  5. lowercase = 'lowercase' in settings
  6. uppercase = 'uppercase' in settings
  7. symbols = 'symbols' in settings
  8. numbers = 'numbers' in settings
  9. user = models.LessPassUser.objects.get(id=entry.user.id)
  10. models.Password.objects.create(id=entry.id, site=entry.site, login=entry.login, user=user,
  11. lowercase=lowercase, uppercase=uppercase, symbols=symbols, numbers=numbers,
  12. counter=entry.password.counter, length=entry.password.length)