# HG changeset patch
# User Pascal Volk <user@localhost.localdomain.org>
# Date 1393178435 0
# Node ID ddcad86f738685fe9c86c62ab832a3fc16aee060
# Parent  8167ba72235c5f4fcce09a928bbbb38ee1bac57d
VMM/account: Account.modify accepts a password hash.

diff -r 8167ba72235c -r ddcad86f7386 VirtualMailManager/account.py
--- a/VirtualMailManager/account.py	Mon Feb 17 23:19:01 2014 +0000
+++ b/VirtualMailManager/account.py	Sun Feb 23 18:00:35 2014 +0000
@@ -261,17 +261,19 @@
     def modify(self, field, value):
         """Update the Account's *field* to the new *value*.
 
-        Possible values for *field* are: 'name' and 'note'.
+        Possible values for *field* are: 'name', 'note' and 'pwhash'.
 
         Arguments:
 
         `field` : str
-          The attribute name: 'name', or 'note'
+          The attribute name: 'name', 'note' or 'pwhash'
         `value` : str
           The new value of the attribute.
         """
-        if field not in ('name', 'note'):
+        if field not in ('name', 'note', 'pwhash'):
             raise AErr(_("Unknown field: '%s'") % field, INVALID_ARGUMENT)
+        if field == 'pwhash':
+            field = 'passwd'
         self._chk_state()
         dbc = self._dbh.cursor()
         dbc.execute('UPDATE users SET %s = %%s WHERE uid = %%s' % field,