Fix bad markup.

This commit is contained in:
Ricky Zhou (周家杰) 2008-03-09 21:05:28 -04:00
parent 74b9fe869d
commit b75d949500
3 changed files with 63 additions and 63 deletions

View file

@ -20,7 +20,7 @@ mail.encoding = 'utf-8'
# If you have sqlite, here's a simple default to get you started # If you have sqlite, here's a simple default to get you started
# in development # in development
sqlalchemy.dburi="postgres://fedora:bunbunbun@localhost/fas2" sqlalchemy.dburi="postgres://fedora:bunbunbun@localhost/fas2"
sqlalchemy.echo=True
# if you are using a database or table type without transactions # if you are using a database or table type without transactions
# (MySQL default, for example), you should turn off transactions # (MySQL default, for example), you should turn off transactions

View file

@ -4,7 +4,7 @@
xmlns:xi="http://www.w3.org/2001/XInclude"> xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../master.html" /> <xi:include href="../master.html" />
<head> <head>
<title>${_('Edit Group')}</title> <title>${_('View Group')}</title>
</head> </head>
<body> <body>
<?python <?python
@ -99,8 +99,8 @@
<script type="text/javascript">var hb1 = new HelpBalloon({dataURL: '${tg.url('/help/get_help/group_sponsor')}'});</script> <script type="text/javascript">var hb1 = new HelpBalloon({dataURL: '${tg.url('/help/get_help/group_sponsor')}'});</script>
</py:if> </py:if>
<py:if test="not group.needs_sponsor"> <py:if test="not group.needs_sponsor">
<a group.needs_sponsor" href="${tg.url('/group/sponsor/%s/%s' % (group.name, role.member.username))}">${_('Approve')}</a> <a href="${tg.url('/group/sponsor/%s/%s' % (group.name, role.member.username))}">${_('Approve')}</a>
<script group.needs_sponsor" type="text/javascript">var hb2 = new HelpBalloon({dataURL: '${tg.url('/help/get_help/group_approve')}'});</script> <script type="text/javascript">var hb2 = new HelpBalloon({dataURL: '${tg.url('/help/get_help/group_approve')}'});</script>
</py:if> </py:if>
</li> </li>
<li py:if="auth.canRemoveUser(person, group, role.member)"> <li py:if="auth.canRemoveUser(person, group, role.member)">

View file

@ -282,65 +282,65 @@ create table visit_identity (
-- --
-- When a person's fedorabugs role is updated, add them to bugzilla queue. -- When a person's fedorabugs role is updated, add them to bugzilla queue.
-- --
create or replace function bugzilla_sync() returns trigger as $bz_sync$ -- create or replace function bugzilla_sync() returns trigger as $bz_sync$
# Decide which row we are operating on and the action to take -- # Decide which row we are operating on and the action to take
if TD['event'] == 'DELETE': -- if TD['event'] == 'DELETE':
# 'r' for removing an entry from bugzilla -- # 'r' for removing an entry from bugzilla
newaction = 'r' -- newaction = 'r'
row = TD['old'] -- row = TD['old']
else: -- else:
# insert or update -- # insert or update
row = TD['new'] -- row = TD['new']
if row['role_status'] == 'approved': -- if row['role_status'] == 'approved':
# approved so add an entry to bugzilla -- # approved so add an entry to bugzilla
newaction = 'a' -- newaction = 'a'
else: -- else:
# no longer approved so remove the entry from bugzilla -- # no longer approved so remove the entry from bugzilla
newaction = 'r' -- newaction = 'r'
--
# Get the group id for fedorabugs -- # Get the group id for fedorabugs
result = plpy.execute("select id from groups where name = 'fedorabugs'", 1) -- result = plpy.execute("select id from groups where name = 'fedorabugs'", 1)
if not result: -- if not result:
# Danger Will Robinson! A basic FAS group does not exist! -- # Danger Will Robinson! A basic FAS group does not exist!
plpy.error('Basic FAS group fedorabugs does not exist') -- plpy.error('Basic FAS group fedorabugs does not exist')
# If this is not a fedorabugs role, no change needed -- # If this is not a fedorabugs role, no change needed
if row['group_id'] != result[0]['id']: -- if row['group_id'] != result[0]['id']:
return None -- return None
--
# Retrieve the bugzilla email address -- # Retrieve the bugzilla email address
plan = plpy.prepare("select email, purpose from person_emails as pee," -- plan = plpy.prepare("select email, purpose from person_emails as pee,"
" email_purposes as epu" -- " email_purposes as epu"
" where epu.id = epu.email_id and pee.person_id = $1" -- " where epu.id = epu.email_id and pee.person_id = $1"
" and purpose in ('bugzilla', 'primary')", -- " and purpose in ('bugzilla', 'primary')",
('text',)) -- ('text',))
result = plpy.execute(plan, row['person_id']) -- result = plpy.execute(plan, row['person_id'])
email = None -- email = None
for record in result: -- for record in result:
email = record['email'] -- email = record['email']
if record['purpose'] == 'bugzilla': -- if record['purpose'] == 'bugzilla':
break -- break
if not email: -- if not email:
raise plpy.error('Cannot approve fedorabugs for person_id(%s) because they have no email address to use with bugzilla' % row['person_id']) -- raise plpy.error('Cannot approve fedorabugs for person_id(%s) because they have no email address to use with bugzilla' % row['person_id'])
--
# If there is already a row in bugzilla_queue update, otherwise insert -- # If there is already a row in bugzilla_queue update, otherwise insert
plan = plpy.prepare("select email from bugzilla_queue where email = $1", -- plan = plpy.prepare("select email from bugzilla_queue where email = $1",
('text',)) -- ('text',))
result = plpy.execute(plan, (email,), 1) -- result = plpy.execute(plan, (email,), 1)
if result: -- if result:
plan = plpy.prepare("update bugzilla_queue set action = $1" -- plan = plpy.prepare("update bugzilla_queue set action = $1"
" where email = $2", ('char', 'text')) -- " where email = $2", ('char', 'text'))
plpy.execute(plan, (newaction, email)) -- plpy.execute(plan, (newaction, email))
else: -- else:
plan = plpy.prepare("insert into bugzilla_queue (email, group_id" -- plan = plpy.prepare("insert into bugzilla_queue (email, group_id"
", person_id, action) values ($1, $2, $3, $4)", -- ", person_id, action) values ($1, $2, $3, $4)",
('text', 'text', 'text', 'char')) -- ('text', 'text', 'text', 'char'))
plpy.execute(plan, (email, row['group_id'], row['person_id'], newaction)) -- plpy.execute(plan, (email, row['group_id'], row['person_id'], newaction))
return None -- return None
$bz_sync$ language plpythonu; -- $bz_sync$ language plpythonu;
--
create trigger role_bugzilla_sync before update or insert or delete -- create trigger role_bugzilla_sync before update or insert or delete
on person_roles -- on person_roles
for each row execute procedure bugzilla_sync(); -- for each row execute procedure bugzilla_sync();
-- --
-- When an email address changes, check whether it needs to be changed in -- When an email address changes, check whether it needs to be changed in