3
2

I've managed to create a duplicate account on my osqa installation (http://ask.soapboxcore.com) and since I can't delete accounts, I tried suspending the duplicate account. I was hoping it would hide the suspended user from the user list, but it kept the account there with suspended across the image. Is there an option to hide suspended users from the user list?

asked 31 Oct '10, 18:24

Mark%20Phipps's gravatar image

Mark Phipps
211238
accept rate: 33%


There's no option for hiding suspended users, but you can filter them from the query in the views. You can edit the osqa/forum/views/users.py file and edit this line:

    users = User.objects.all()

and change it into this:

    users = User.objects.filter(is_active=True)

I prefer letting the administrators (superusers) to see the suspended users, and hide the suspended users only from the others, so I changed it into:

    if request.user.is_superuser:
        users = User.objects.all()
    else:
        users = User.objects.filter(is_active=True)

Hope that helps.

link

answered 12 Dec '10, 15:43

eman's gravatar image

eman
714
accept rate: 66%

Hi, afaik there's not an option yet to hide suspended users, but as I was having trouble with some nasty casino/poker spammers I figured out a little (hopefully temporary) solution.

Please note:

  • This will only remove suspended user from the user list and user search results, not the user profile or any link to it.
  • I'm working with revision SVN-596 so I can't guarantee this'll work on other versions although there might be a similar solution.
  • This is probably not the best solution or even a recommended one.
  • It involves some minor tinkering with html.

Find the following file in your site's directory tree /forum/skins/default/templates/users/users.html

There you'll find the following code: Sorry for the pastebin link, I couldn't escape html. which you need to rewrite into something like this

Hope this helps.

link

answered 03 Nov '10, 00:11

kirbuchi's gravatar image

kirbuchi
51237
accept rate: 0%

edited 03 Nov '10, 00:13

@kirbuchi: Essentially, you're hard coding the page to not display suspended users. That works, but not for everyone. I have not looked too deeply into the code, but when the call is made to the database, I wonder if there is an option/parameter to only pull non-suspended users. If there is, perhaps a preference can be added to turn it on or off.

(03 Nov '10, 19:09) Mark Phipps

@Mark yeah I know, it works for me but I'd like the solution you propose much better. If you figure it out please let me know.

(03 Nov '10, 23:50) kirbuchi

We are getting this casino spam as well. I would also like to see a solution to this.

(04 Nov '10, 18:43) pgardiye
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×18
×18
×4

Asked: 31 Oct '10, 18:24

Seen: 521 times

Last updated: 12 Dec '10, 15:43

powered by OSQA