0001-utils-add-special-case-for-mapping-the-User.password.patch
src/authentic2_auth_fc/utils.py | ||
---|---|---|
76 | 76 |
elif 'compute' in mapping: |
77 | 77 |
if mapping['compute'] == 'today': |
78 | 78 |
value = datetime.date.today() |
79 |
elif mapping['compute'] == 'random': |
|
80 |
value = unicode(uuid.uuid4()) |
|
79 | 81 |
else: |
80 | 82 |
raise NotImplementedError |
81 | 83 | |
... | ... | |
143 | 145 |
continue |
144 | 146 |
if mapping.get('if-tag') and mapping['if-tag'] not in tags: |
145 | 147 |
continue |
146 |
if hasattr(user, attribute): |
|
148 | ||
149 |
if attribute == 'password': |
|
150 |
if mapping.get('if-empty') and user.has_usable_password(): |
|
151 |
continue |
|
152 |
save_user = True |
|
153 |
user.set_password(value) |
|
154 |
elif hasattr(user, attribute): |
|
147 | 155 |
save_user = True |
148 | 156 |
if mapping.get('if-empty') and getattr(user, attribute): |
149 | 157 |
continue |
150 |
- |