@@ -511,6 +511,9 @@ let courseTable = function ($rootScope, $timeout, CourseActionCreators, $compile
511
511
var sectionGroup = _ . findWhere ( scope . view . state . sectionGroups . list , { courseId : courseId , termCode : termCode } ) ; // eslint-disable-line no-undef
512
512
var plannedSeats = $el . val ( ) === "" ? null : parseInt ( $el . val ( ) ) ;
513
513
514
+ const course = scope . view . state . courses . list [ courseId ] ;
515
+ const isNumericSection = isNumber ( course . sequencePattern ) ;
516
+
514
517
if ( isNaN ( plannedSeats ) ) { return ; }
515
518
516
519
if ( sectionGroup ) {
@@ -525,8 +528,10 @@ let courseTable = function ($rootScope, $timeout, CourseActionCreators, $compile
525
528
526
529
// Save existing sectionGroup
527
530
sectionGroup . plannedSeats = plannedSeats ;
528
- if ( plannedSeats >= proposedSectionSeatTotal ) {
529
- CourseActionCreators . updateSectionGroup ( sectionGroup ) ;
531
+ if ( ! isNumericSection ) {
532
+ if ( plannedSeats >= proposedSectionSeatTotal ) {
533
+ CourseActionCreators . updateSectionGroup ( sectionGroup ) ;
534
+ }
530
535
531
536
// Check if any overflowed sections can be updated. If yes, update them.
532
537
if ( currentSectionSeatTotal !== proposedSectionSeatTotal ) {
@@ -535,10 +540,11 @@ let courseTable = function ($rootScope, $timeout, CourseActionCreators, $compile
535
540
}
536
541
537
542
// If sequence is numeric sync the seats on the section to the new sectionGroup value
538
- if ( sectionGroup . sections . length === 1 && isNumber ( sectionGroup . sections [ 0 ] . sequenceNumber ) ) {
543
+ if ( isNumericSection && sectionGroup . sections . length === 1 ) {
539
544
let section = scope . view . state . sections . list [ sectionGroup . sections [ 0 ] . id ] ;
540
545
section . seats = sectionGroup . plannedSeats ;
541
546
CourseActionCreators . updateSection ( section ) ;
547
+ CourseActionCreators . updateSectionGroup ( sectionGroup ) ;
542
548
}
543
549
} else if ( plannedSeats ) {
544
550
// Create a new sectionGroup
0 commit comments