Revision 4220c336 snf-astakos-app/astakos/im/management/commands/user-modify.py

b/snf-astakos-app/astakos/im/management/commands/user-modify.py
257 257
                group = Group.objects.get(name=groupname)
258 258
                user.groups.add(group)
259 259
            except Group.DoesNotExist, e:
260
                self.stdout.write(
260
                self.stderr.write(
261 261
                    "Group named %s does not exist\n" % groupname)
262 262

  
263 263
        groupname = options.get('delete-group')
......
266 266
                group = Group.objects.get(name=groupname)
267 267
                user.groups.remove(group)
268 268
            except Group.DoesNotExist, e:
269
                self.stdout.write(
269
                self.stderr.write(
270 270
                    "Group named %s does not exist\n" % groupname)
271 271

  
272 272
        pname = options.get('add-permission')
......
274 274
            try:
275 275
                r, created = add_user_permission(user, pname)
276 276
                if created:
277
                    self.stdout.write(
277
                    self.stderr.write(
278 278
                        'Permission: %s created successfully\n' % pname)
279 279
                if r > 0:
280
                    self.stdout.write(
280
                    self.stderr.write(
281 281
                        'Permission: %s added successfully\n' % pname)
282 282
                elif r == 0:
283
                    self.stdout.write(
283
                    self.stderr.write(
284 284
                        'User has already permission: %s\n' % pname)
285 285
            except Exception, e:
286 286
                raise CommandError(e)
......
290 290
            try:
291 291
                r = remove_user_permission(user, pname)
292 292
                if r < 0:
293
                    self.stdout.write(
293
                    self.stderr.write(
294 294
                        'Invalid permission codename: %s\n' % pname)
295 295
                elif r == 0:
296
                    self.stdout.write('User has not permission: %s\n' % pname)
296
                    self.stderr.write('User has not permission: %s\n' % pname)
297 297
                elif r > 0:
298
                    self.stdout.write(
298
                    self.stderr.write(
299 299
                        'Permission: %s removed successfully\n' % pname)
300 300
            except Exception, e:
301 301
                raise CommandError(e)
......
374 374
        self.stdout.write("Confirm? [y/N] ")
375 375
        response = raw_input()
376 376
        if string.lower(response) not in ['y', 'yes']:
377
            self.stdout.write("Aborted.\n")
377
            self.stderr.write("Aborted.\n")
378 378
            exit()
379 379

  
380 380
    def handle_limits_user(self, user, res, capacity, style):

Also available in: Unified diff