[Bps-public-commit] r9540 - RT-Extension-TicketLocking/lib/RT/Extension
ruz at bestpractical.com
ruz at bestpractical.com
Fri Nov 2 16:04:28 EDT 2007
Author: ruz
Date: Fri Nov 2 16:04:28 2007
New Revision: 9540
Modified:
RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm
Log:
* minor
Modified: RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm
==============================================================================
--- RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm (original)
+++ RT-Extension-TicketLocking/lib/RT/Extension/TicketLocking.pm Fri Nov 2 16:04:28 2007
@@ -235,16 +235,16 @@
sub Locked {
my $ticket = shift;
+
my $lock = $ticket->FirstAttribute('RT_Lock');
- if($lock) {
- my $duration = time() - $lock->Content->{'Timestamp'};
- my $expiry = RT->Config->Get('LockExpiry');
- if($expiry) {
- unless($duration < $expiry) {
- $ticket->DeleteAttribute('RT_Lock');
- undef $lock;
- }
- }
+ return $lock unless $lock;
+
+ return $lock unless my $expiry = RT->Config->Get('LockExpiry');
+
+ my $duration = time() - $lock->Content->{'Timestamp'};
+ unless ( $duration < $expiry ) {
+ $ticket->DeleteAttribute('RT_Lock');
+ undef $lock;
}
return $lock;
}
More information about the Bps-public-commit
mailing list