Here are some pre-emptively forumulated FAQ’s for the admins
Check that they are in the Staff security group Check that their account hasn’t been disabled by an admin
Go in the admin page and look for them there
Say you want some information that isn’t visible on the page, but you are pretty sure is stored in the database somewhere. Give me a call and I can do some database queries for you.
For example, say you want a list of all the members of group “x”, or you want to see a user’s sign up/unsign up history, or you want to see a custom user report such as how many events does user a have in common with user b.
Those are just a few of many things that can be quickly computed with django’s database query API in python. Feel free to take a look at the source code to get a feel for what data is in there and what’s not.
https://github.com/luisnaranjo733/bbhs-intranet
The database stuff is in chaperone/models.py or intranet/models.py
If you want to hack at it yourself, here is a sample query:
cd ~/bbhs-intranet python manage.py shell from chaperone.models import Event, Note from intranet.models import UserProfile
a = UserProfile.objects.get(username=’cconnors’).user b = UserProfile.objects.get(username=’mfreyman’).user
matches = []
volunteers = event.getVolunteers() #this is a list of volunteers if a in volunteers and b in volunteers:
matches.append(event)
print matches
Just disable the cron jobs:
~/bbhs_intranet/chaperone/cron/daily.py
This job runs once a day, and it checks for events that are happening within two days.
It sends an email reminder about the event to all of the signed up chaperones.
~/bbhs_intranet/chaperone/cron/daily.py
This runs once a month, and it goes through the users and checks to see if they’ve fulfilled their service requirement. If they haven’t, then it sends them an email to remind them to get on it.
It’s a pain in the ass and I don’t advise it.
sudo apt-get install git git clone https://github.com/luisnaranjo733/bbhs-intranet //will download code
sudo apt-get install python-pip // installing dependencies for python2.7 sudo pip install -r requirements.txt
You need to set up a dedicated python production server. I used mod_wsgi for apache. There are nginx options and several other python specific servers.
sudo mv ~/bbhs-intranet/faculty.bishopblanchet.org /var/www/faculty.bishopblanchet.org you may have permission issues with this - fix with chmod
sudo apt-get install ldapsearch
cd ~/bbhs-intranet sudo sh reset_db.sh // log in with someone who is a member of the “Staff” security group or // manually create a group named “Staff” in the admin page python populateFromLDAP.py // this will populate everyone in ou=Faculty python populateFromLDAP.py staff // this will populate everyone in ou=Administration
edit ~/bbhs_intranet/bbhs/settings.py
Change OBLIGATION_NUMBER = 4 Go to the admin page, then go to Users Select the admin action “Normalize Yearly Obligation” and select everyone
This will reset every active user’s events done count for this year, and their events needed count for this year.
You should probably just disable them. Go to the admin page and click disable and them save.
I coded it so that disabled users don’t get to do anything.
Go to the admin page, go to events, and select all of the events you want to advertise, then select the “event ad for unregistered users” action and hit go.
Select the “event reminder for registered users” if that’s what suits you
Edit the very bottom of the settings file
Just modify the settings.py file. It’s pretty straightforward, but let me know if you need any help. All relevant LDAP related variables are prefixed with AUTH_LDAP_*
Make sure to restart the apache server for changes to take effect
cd ~/bbhs_intranet/ git checkout – .
This will reset all the code in this directory to the state I left it in last.
This will not change /var/www/faculty.bishopblanchet.org, so I recommend not touching that folder
In case you deleted ~/bbhs_intranet or ~/bbhs-intranet/.git
git clone https://github.com/luisnaranjo733/bbhs-intranet ~/bbhs_intranet
The html templates are located in ~/bbhs_intranet/bbhs/templates
You can safely make changes, but make sure you don’t delete anything that looks like:
{% stuff %} // template engine constructs, for loops, block tags, etc.. or {{ stuff }} variables
If you want to get fancy look up Django’s templating system. It’s not hard to learn.
You could take a look at chaperone/views.py or intranet/views.py file for figuring out what objects and lists are being passed to the templates before they are rendered in static html
Add your static files to ~/bbhs_intranet/bbhs/static/
cd ~/bbhs_intranet/ sudo python manage.py collectstatic //say yes // you may have to restart the apache server
Group matching query does not exist. Lookup parameters were {‘name’: ‘Intranet_Event_Admin’}
Create the Intranet_Event_Admin group in the admin page or log in with a user who is a part of that group
There will be an email that will go out to whoever the DEADLINE_EMAIL variable is set to in ~/bbhs_intranet/bbhs/settings.py that will contain a list of the users who missed the chaperone requirement deadline, and their information.